Fix grep regex escaping for extended regex (ERE)
Replace preg_quote() with proper ERE escaping since grep -E uses extended regex syntax, not PHP/PCRE. This ensures special characters in registry URLs (dots, etc.) are properly escaped. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
511415770a
commit
62aa7397da
1 changed files with 3 additions and 2 deletions
|
|
@ -89,8 +89,9 @@ private function buildImagePruneCommand($applicationImageRepos): string
|
|||
} else {
|
||||
// Build grep pattern to exclude application image repositories
|
||||
$excludePatterns = $applicationImageRepos->map(function ($repo) {
|
||||
// Escape special characters for grep basic regex
|
||||
return preg_quote($repo, '/');
|
||||
// Escape special characters for grep extended regex (ERE)
|
||||
// ERE special chars: . \ + * ? [ ^ ] $ ( ) { } |
|
||||
return preg_replace('/([.\\\\+*?\[\]^$(){}|])/', '\\\\$1', $repo);
|
||||
})->implode('|');
|
||||
|
||||
// Delete unused images that:
|
||||
|
|
|
|||
Loading…
Reference in a new issue