From 99d43b90564aa577d578d6454a7c3c55e520dc12 Mon Sep 17 00:00:00 2001 From: Bartholomew Date: Thu, 21 Mar 2024 09:27:24 +0100 Subject: [PATCH] Fixed issue where CSS comments containing a comma would be prefixed incorrectly, which could cause syntax errors in the CSS. --- class-gwiz-gf-code-chest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class-gwiz-gf-code-chest.php b/class-gwiz-gf-code-chest.php index 79b1bd6..b011d8d 100644 --- a/class-gwiz-gf-code-chest.php +++ b/class-gwiz-gf-code-chest.php @@ -679,7 +679,7 @@ public function prefix_css_selectors( $css, $prefix ) { * Find all CSS selectors, but ignore all `@` rules such as @font-face, @media, etc. as they are * defined globally and not can't be scoped to a certion "parent" selector. */ - return preg_replace_callback('/^\s*(?!@)([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/m', function( $matches ) use ( $prefix ) { + return preg_replace_callback('/^\s*(?!@)([^\r\n,{}\/]+)(,(?=[^}]*{)|\s*{)/m', function( $matches ) use ( $prefix ) { return $prefix . ' ' . trim( $matches[1] ) . $matches[2]; }, $css); }