[PHP] Limit structured URL rewriting to mapped base components - #307
Open
adamziel wants to merge 3 commits into
Open
[PHP] Limit structured URL rewriting to mapped base components#307adamziel wants to merge 3 commits into
adamziel wants to merge 3 commits into
Conversation
adamziel
force-pushed
the
codex/replace-structured-url-bases
branch
from
August 13, 2026 15:50
50a4542 to
bfda182
Compare
adamziel
force-pushed
the
codex/replace-structured-url-bases
branch
from
August 13, 2026 21:28
bfda182 to
96934ae
Compare
adamziel
changed the base branch from
trunk
to
codex/pin-blueprint-sqlite-test-fixture
August 13, 2026 21:29
adamziel
force-pushed
the
codex/replace-structured-url-bases
branch
from
August 13, 2026 23:53
96934ae to
c1fc2b1
Compare
Base automatically changed from
codex/pin-blueprint-sqlite-test-fixture
to
trunk
August 14, 2026 12:50
adamziel
force-pushed
the
codex/replace-structured-url-bases
branch
from
August 14, 2026 12:51
c1fc2b1 to
6b02ecd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BlockMarkupUrlProcessornow changes only the mapped base in each decoded structured URL before passing the result to the existing setter.For this mapping:
this decoded URL:
becomes:
The unmatched path, query, fragment, and percent-escape spelling come from the input value. The enclosing serializer still owns HTML entities, CSS quoting, and block JSON escaping. Text-node URL handling is unchanged.
WPURL::replace_base_url()owns the slash-delimited source locator and returns one validated, source-preserving decoded URL. Spellings whose base boundary cannot be located safely are left alone.BlockMarkupUrlProcessor::replace_base_url()only selects the text or structured result and callsset_url(). The setter handles source no-ops, and repeated writes to one CSS token are last-write-wins. This removes the replacement loop, CSS materialization and reseeking, and CSS URL index state fromBlockMarkupUrlProcessor.The rewrite cache stores the selected mapping rather than a rendered URL, so every structured occurrence is converted from its own decoded spelling.
Testing
The focused suites pass:
The complete Data Liberation suite ran 2,392 tests. Its only local failures were two remote-fixture DNS errors and the dependent frontloading assertion while network access was disabled. Changed files pass PHP 7.2 compatibility checks and
git diff --check; PHPCS reports only the same two pre-existing CSS alignment warnings.