[Cache] Accept '_' and ':' in prefix passed to AbstractAdapter::clear()#64336
Merged
nicolas-grekas merged 1 commit intoMay 23, 2026
symfony:5.4symfony/symfony:5.4from
nicolas-grekas:fix-64328-cache-prefix-underscorenicolas-grekas/symfony:fix-64328-cache-prefix-underscoreCopy head branch name to clipboard
Merged
[Cache] Accept '_' and ':' in prefix passed to AbstractAdapter::clear()#64336nicolas-grekas merged 1 commit intosymfony:5.4symfony/symfony:5.4from nicolas-grekas:fix-64328-cache-prefix-underscorenicolas-grekas/symfony:fix-64328-cache-prefix-underscoreCopy head branch name to clipboard
nicolas-grekas merged 1 commit into
symfony:5.4symfony/symfony:5.4from
nicolas-grekas:fix-64328-cache-prefix-underscorenicolas-grekas/symfony:fix-64328-cache-prefix-underscoreCopy head branch name to clipboard
Conversation
nicolas-grekas
added a commit
that referenced
this pull request
May 24, 2026
…fix (nicolas-grekas) This PR was merged into the 5.4 branch. Discussion ---------- [Cache] skip tests for adapters that cannot clear by prefix | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Something I forgot in #64336 Commits ------- ac5bba2 [Cache] skip tests for adapters that cannot clear by prefix
This was referenced May 27, 2026
Merged
Merged
Merged
Merged
Merged
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.
The prefix-validation regex added to
AbstractAdapter::clear()rejected_, which broke Doctrine ORM second-level cache region invalidation (regions are passed asDC2_REGION_<name>). It also rejected:, which is the conventional Redis namespace separator.This PR extends the allowed character class to include
_and:. To keep SQL-backed adapters safe,_(a SQL LIKE single-character wildcard) is now escaped viaESCAPE '!'inPdoAdapter::doClear()andDoctrineDbalAdapter::doClear(). The!escape character is itself rejected by the validation regex, so collisions are not possible.