Loading core/lib/Drupal/Core/Asset/CssOptimizer.php +2 −2 Original line number Diff line number Diff line Loading @@ -90,8 +90,8 @@ protected function processFile($css_asset) { // Store base path. $this->rewriteFileURIBasePath = $css_base_path . '/'; // Anchor all paths in the CSS with its base URL, ignoring external and absolute paths. return preg_replace_callback('/url\(\s*[\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\s*\)/i', [$this, 'rewriteFileURI'], $contents); // Anchor all paths in the CSS with its base URL, ignoring external and absolute paths and paths starting with '#'. return preg_replace_callback('/url\(\s*[\'"]?(?![a-z]+:|\/+|#|%23)([^\'")]+)[\'"]?\s*\)/i', [$this, 'rewriteFileURI'], $contents); } /** Loading core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php +12 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,18 @@ public function providerTestOptimize() { ], file_get_contents($absolute_path . 'quotes.css.optimized.css'), ], [ [ 'group' => -100, 'type' => 'file', 'weight' => 0.013, 'media' => 'all', 'preprocess' => TRUE, 'data' => $path . 'import3.css', 'basename' => 'import3.css', ], file_get_contents($absolute_path . 'import3.css.optimized.css'), ], ]; } Loading core/tests/Drupal/Tests/Core/Asset/css_test_files/import3.css 0 → 100644 +6 −0 Original line number Diff line number Diff line div { clip-path: url('#clip-cloud'); } div { clip-path: url('/abc/#clip-cloud'); } core/tests/Drupal/Tests/Core/Asset/css_test_files/import3.css.optimized.css 0 → 100644 +1 −0 Original line number Diff line number Diff line div{clip-path:url('#clip-cloud');}div{clip-path:url('/abc/#clip-cloud');} Loading
core/lib/Drupal/Core/Asset/CssOptimizer.php +2 −2 Original line number Diff line number Diff line Loading @@ -90,8 +90,8 @@ protected function processFile($css_asset) { // Store base path. $this->rewriteFileURIBasePath = $css_base_path . '/'; // Anchor all paths in the CSS with its base URL, ignoring external and absolute paths. return preg_replace_callback('/url\(\s*[\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\s*\)/i', [$this, 'rewriteFileURI'], $contents); // Anchor all paths in the CSS with its base URL, ignoring external and absolute paths and paths starting with '#'. return preg_replace_callback('/url\(\s*[\'"]?(?![a-z]+:|\/+|#|%23)([^\'")]+)[\'"]?\s*\)/i', [$this, 'rewriteFileURI'], $contents); } /** Loading
core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php +12 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,18 @@ public function providerTestOptimize() { ], file_get_contents($absolute_path . 'quotes.css.optimized.css'), ], [ [ 'group' => -100, 'type' => 'file', 'weight' => 0.013, 'media' => 'all', 'preprocess' => TRUE, 'data' => $path . 'import3.css', 'basename' => 'import3.css', ], file_get_contents($absolute_path . 'import3.css.optimized.css'), ], ]; } Loading
core/tests/Drupal/Tests/Core/Asset/css_test_files/import3.css 0 → 100644 +6 −0 Original line number Diff line number Diff line div { clip-path: url('#clip-cloud'); } div { clip-path: url('/abc/#clip-cloud'); }
core/tests/Drupal/Tests/Core/Asset/css_test_files/import3.css.optimized.css 0 → 100644 +1 −0 Original line number Diff line number Diff line div{clip-path:url('#clip-cloud');}div{clip-path:url('/abc/#clip-cloud');}