Commit 4b6cd91a authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#168620 by hass: remove extraneous @charset rules from the compressed CSS...

#168620 by hass: remove extraneous @charset rules from the compressed CSS files, because Safari chokes on them. Actual testing was done at #150759
parent fc79722b
......@@ -1633,6 +1633,8 @@ function drupal_build_css_cache($types, $filename) {
foreach ($type as $file => $cache) {
if ($cache) {
$contents = file_get_contents($file);
// Remove multiple charset declarations for standards compliance (and fixing Safari problems)
$contents = preg_replace('/^@charset\s+[\'"](\S*)\b[\'"];/i', '', $contents);
// 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, '/')) .'/';
......
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