From 4b6cd91aa824c77a34f65fb20e6a32ae268fa9bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= <gabor@hojtsy.hu>
Date: Thu, 27 Sep 2007 17:11:07 +0000
Subject: [PATCH] #168620 by hass: remove extraneous @charset rules from the
 compressed CSS files, because Safari chokes on them. Actual testing was done
 at #150759

---
 includes/common.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/includes/common.inc b/includes/common.inc
index 9c233c2d5857..299924c936fc 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -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, '/')) .'/';
-- 
GitLab