summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-08-03 02:14:50 +0000
committerDries Buytaert <dries@buytaert.net>2010-08-03 02:14:50 +0000
commit98ef4e3e4ad8cc330af27a267ee0ab2406c1939f (patch)
treedc4dbe9b9c45f10e6d73192fed5128bfe855b50f /includes
parent79caf33568632d75a9cdb73b143b356df15f7af5 (diff)
downloadbrdo-98ef4e3e4ad8cc330af27a267ee0ab2406c1939f.tar.gz
brdo-98ef4e3e4ad8cc330af27a267ee0ab2406c1939f.tar.bz2
- Patch #258846 by casey, Gribnif: CSS aggregation fails to parse some url()'s.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc
index ccebe2813..d02141269 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3195,7 +3195,7 @@ function drupal_build_css_cache($css) {
$base = base_path() . dirname($stylesheet['data']) . '/';
_drupal_build_css_path(NULL, $base);
// Prefix all paths within this CSS file, ignoring external and absolute paths.
- $data .= preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', '_drupal_build_css_path', $contents);
+ $data .= preg_replace_callback('/url\(\s*[\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\s*\)/i', '_drupal_build_css_path', $contents);
}
}
@@ -3327,7 +3327,7 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
// Replaces @import commands with the actual stylesheet content.
// This happens recursively but omits external files.
- $contents = preg_replace_callback('/@import\s*(?:url\()?[\'"]?(?![a-z]+:)([^\'"\()]+)[\'"]?\)?;/', '_drupal_load_stylesheet', $contents);
+ $contents = preg_replace_callback('/@import\s*(?:url\(\s*)?[\'"]?(?![a-z]+:)([^\'"\()]+)[\'"]?\s*\)?\s*;/', '_drupal_load_stylesheet', $contents);
return $contents;
}
@@ -3351,7 +3351,7 @@ 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]+:|\/+)/i', 'url(\1'. $directory, $file);
+ return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+)/i', 'url(\1'. $directory, $file);
}
/**