Commit 4c9fc80f authored by Dries's avatar Dries

- Patch #113829 by m3avrck: improved code comments.

parent 5729c22f
......@@ -1511,7 +1511,8 @@ function drupal_build_css_cache($types, $filename) {
foreach ($type as $file => $cache) {
if ($cache) {
$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.
// 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);
......@@ -1521,6 +1522,7 @@ function drupal_build_css_cache($types, $filename) {
}
}
// Per the W3C specification at http://www.w3.org/TR/REC-CSS2/cascade.html#at-import,
// @import rules must proceed any other style, so we move those to the top.
$regexp = '/@import[^;]+;/i';
preg_match_all($regexp, $data, $matches);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment