summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-09-29 17:52:46 +0000
committerDries Buytaert <dries@buytaert.net>2009-09-29 17:52:46 +0000
commit8f1ec56d35004b188b176a85c89aee6db29cdc55 (patch)
tree478e4b8a27463fbc0f21cbf3717ff5073e12c4cf
parentdd7a450a7c079adc2535651a71265ba0b6cf7470 (diff)
downloadbrdo-8f1ec56d35004b188b176a85c89aee6db29cdc55.tar.gz
brdo-8f1ec56d35004b188b176a85c89aee6db29cdc55.tar.bz2
- Patch #584370 by JoshuaRogers, JacobSingh | mattyoung: fixed bug with CSS file inclusion in the CSS optimization code.
-rw-r--r--includes/common.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 9a0d63310..ce37466c4 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3052,9 +3052,6 @@ function drupal_load_stylesheet($file, $optimize = NULL) {
* Contents of the stylesheet including the imported stylesheets.
*/
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);
// Remove multiple charset declarations for standards compliance (and fixing Safari problems).
$contents = preg_replace('/^@charset\s+[\'"](\S*)\b[\'"];/i', '', $contents);
@@ -3066,6 +3063,10 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
[\n\r] # Remove line breaks.
>x', '\1', $contents);
}
+
+ // 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);
return $contents;
}