[BUGFIX] Keep excludes with escaped slashes working - #107
Merged
Conversation
Quoting the configured exclude entries (#106) broke the workaround extensions used for nested directories: an entry written as `Resources\/Private\/Build` was passed to preg_quote as is, so the backslash itself got escaped and the resulting pattern only matched a directory whose name literally contains a backslash. Those extensions silently packaged the directory they excluded before. Strip the escaped slashes before quoting, so both notations describe the same directory and no extension configuration needs a change.
eliashaeussler
approved these changes
Sep 1, 2026
Member
|
Thanks for the follow-up! ❤️ |
CybotTM
added a commit
to CybotTM/tailor
that referenced
this pull request
Sep 2, 2026
An exclude entry that quietly matches nothing is the failure the whole filter exists to prevent: a published archive carrying the very directory the configuration was supposed to keep out. `Resources/Private/Build/` written with a trailing slash, with a leading `./` or with backslashes as separators reads like a valid exclude and packages the directory anyway, without a warning and without an error. Report an entry when the created archive still contains what the entry names, together with a hint about the most likely reason. Comparing against the packaged paths rather than counting pattern matches keeps two cases quiet which are not a problem: an entry for a directory the extension does not have - exclude configurations are shared between extensions and the shipped default covers a lot of them - and an entry already covered by a shorter one next to it. Entries still written with escaped slashes are reported as well, since the escaping is only accepted for compatibility since TYPO3#107. Assisted-by: claude-code:claude-opus-5 Agent-Session: https://claude.ai/code/session_01CFdZJzsCjJ7rmT1u9snkiv Agent-Host: 0493f0 Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
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.
Follow-up to #106, addressing the breaking change @eliashaeussler pointed out.
#106 quotes the configured exclude entries so a nested directory name such as
Resources/Private/Buildno longer closes the pattern early. Extensions that already worked around that by escaping the slashes themselves —Resources\/Private\/Build, see the code search — now hand a backslash topreg_quote, which escapes it in turn. The resulting pattern matches only a directory whose name literally contains a backslash, so those extensions silently package the directory they meant to exclude.The fix strips the escaped slashes before quoting, in a small
quoteExcludePattern()helper used for both the directory and the file rule. Both notations then describe the same directory and no extension configuration needs to change — nothing about this is breaking any more.The added test packages the same tree as the one from #106, but with the escaped fixture configuration. Against this branch without the
str_replace()it fails withFailed asserting that an array does not contain 'Resources/Private/Build/gulpfile.js'; with it, the unit suite is green (154 tests) andcomposer csreports no findings.The README section on excluding paths now spells out how the entries are matched and that both notations are accepted.
https://claude.ai/code/session_018cdX1rvZ9kZjub3MjjQnY4