Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Cache] Accept '_' and ':' in prefix passed to AbstractAdapter::clear()#64336

Merged
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
May 23, 2026
Merged

[Cache] Accept '_' and ':' in prefix passed to AbstractAdapter::clear()#64336
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
Copy link
Copy Markdown
Member

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #64328
License MIT

The prefix-validation regex added to AbstractAdapter::clear() rejected _, which broke Doctrine ORM second-level cache region invalidation (regions are passed as DC2_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 via ESCAPE '!' in PdoAdapter::doClear() and DoctrineDbalAdapter::doClear(). The ! escape character is itself rejected by the validation regex, so collisions are not possible.

@symfony symfony deleted a comment from carsonbot May 22, 2026
@nicolas-grekas nicolas-grekas merged commit c3b3711 into symfony:5.4 May 23, 2026
0 of 11 checks passed
@nicolas-grekas nicolas-grekas deleted the fix-64328-cache-prefix-underscore branch May 23, 2026 14:01
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.