summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-12-15 07:47:08 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-12-15 07:47:08 +0000
commit72f4e5d6e66164f270d77e7a180eb7d51a1e7dce (patch)
treec5ac0e0498a669d8f34d7daa9c4f83abec1e5d67 /includes
parent46392b264c67611388a7d188e4fc29b848f9b388 (diff)
downloadbrdo-72f4e5d6e66164f270d77e7a180eb7d51a1e7dce.tar.gz
brdo-72f4e5d6e66164f270d77e7a180eb7d51a1e7dce.tar.bz2
#102877: Don't let the css preprocessor mess up @import in some themes.
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 ff86ba85b..c2e5ca8d0 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1487,10 +1487,10 @@ function drupal_build_css_cache($types, $filename) {
$contents = file_get_contents($file);
// Return the path to where this CSS file originated from, stripping off the name of the file at the end of the path.
$path = base_path() . substr($file, 0, strrpos($file, '/')) .'/';
+ // Wraps all @import arguments in url().
+ $contents = preg_replace('/@import\s+(?!url)[\'"]?(\S*)\b[\'"]?/i', '@import url("\1")', $contents);
// Fix all paths within this CSS file, ignoring absolute paths.
- $contents = preg_replace('/url\(([\'"]?)(?![a-z]+:)/i', 'url(\1'. $path . '\2', $contents);
- // Fix any @import that don't use url() and is not absoslute.
- $data .= preg_replace('/@import\s*([\'"]?)(?![a-z]+:)/i', '@import \1'. $path . '\2', $contents);
+ $data .= preg_replace('/url\(([\'"]?)(?![a-z]+:)/i', 'url(\1'. $path . '\2', $contents);
}
}
}