From 96fd2ec657b08867f5f1eab9d840f00d27b4b7d5 Mon Sep 17 00:00:00 2001 From: hackolein Date: Fri, 20 Nov 2020 10:02:10 +0100 Subject: [PATCH] Match paths sent to theme:sync more exactly (#5334) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `artisan theme:sync --target=database --force --paths=layouts/,pages/,partials/` But at the moment it also synchronizes paths that should not be synchronized. For example: `content/static-pages/`. Because here the pattern applies to `pages/`. The fix is that the pattern starts at the beginning of the line. Co-authored-by: Heiko Böhme --- modules/system/console/ThemeSync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/console/ThemeSync.php b/modules/system/console/ThemeSync.php index f709921d0..2f813ba27 100644 --- a/modules/system/console/ThemeSync.php +++ b/modules/system/console/ThemeSync.php @@ -105,7 +105,7 @@ class ThemeSync extends Command foreach ($userPaths as $userPath) { foreach ($themePaths as $themePath) { - $pregMatch = '/' . str_replace('/', '\/', $userPath) . '/i'; + $pregMatch = '/^' . str_replace('/', '\/', $userPath) . '/i'; if ($userPath === $themePath || preg_match($pregMatch, $themePath)) { $paths[] = $themePath;