diff --git a/includes/common.inc b/includes/common.inc index 20cc82b..153a078 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -3606,8 +3606,9 @@ function drupal_build_css_cache($css) { } _drupal_build_css_path(NULL, $css_base_url . '/'); - // Anchor all paths in the CSS with its base URL, ignoring external and absolute paths. - $data .= preg_replace_callback('/url\(\s*[\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\s*\)/i', '_drupal_build_css_path', $contents); + // Anchor all paths in the CSS with its base URL, ignoring external, + // absolute, and SVG (#) paths. + $data .= preg_replace_callback('/url\(\s*[\'"]?(?![a-z]+:|\/+|\#+)([^\'")]+)[\'"]?\s*\)/i', '_drupal_build_css_path', $contents); } } @@ -3803,8 +3804,8 @@ function _drupal_load_stylesheet($matches) { // Alter all internal url() paths. Leave external paths alone. We don't need // to normalize absolute paths here (i.e. remove folder/... segments) because - // that will be done later. - return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+)([^\'")]+)([\'"]?)\s*\)/i', 'url(\1' . $directory . '\2\3)', $file); + // that will be done later. Also ignore SVG paths (#). + return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+|\#+)([^\'")]+)([\'"]?)\s*\)/i', 'url(\1' . $directory . '\2\3)', $file); } /** diff --git a/modules/color/color.module b/modules/color/color.module index 5b441aa..e6882d7 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -474,8 +474,9 @@ function color_scheme_form_submit($form, &$form_state) { $base = base_path() . dirname($paths['source'] . $file) . '/'; _drupal_build_css_path(NULL, $base); - // Prefix all paths within this CSS file, ignoring absolute paths. - $style = preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', '_drupal_build_css_path', $style); + // Prefix all paths within this CSS file, ignoring external, absolute, and + // SVG (#) paths. + $style = preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+|\#+)([^\'")]+)[\'"]?\)/i', '_drupal_build_css_path', $style); // Rewrite stylesheet with new colors. $style = _color_rewrite_stylesheet($theme, $info, $paths, $palette, $style);