#168620 by hass: remove extraneous @charset rules from the compressed CSS files, because Safari chokes on them. Actual testing was done at #150759

6.x
Gábor Hojtsy 2007-09-27 17:11:07 +00:00
parent fc79722b39
commit 4b6cd91aa8
1 changed files with 2 additions and 0 deletions

View File

@ -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, '/')) .'/';