Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Fix grep regex escaping for extended regex (ERE)

Andras Bacsai62aa7397dab6
diff --git a/app/Actions/Server/CleanupDocker.php b/app/Actions/Server/CleanupDocker.php
index d9b4b5a6b7..076f7d0c58 100644
--- a/app/Actions/Server/CleanupDocker.php
+++ b/app/Actions/Server/CleanupDocker.php
@@ -89,8 +89,9 @@ class CleanupDocker
} 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: