 docroot/includes/common.inc | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/docroot/includes/common.inc b/docroot/includes/common.inc
index 262e1c5..ab7684a 100644
--- a/docroot/includes/common.inc
+++ b/docroot/includes/common.inc
@@ -3565,15 +3565,8 @@ function drupal_build_css_cache($css) {
       if ($stylesheet['type'] == 'file') {
         $contents = drupal_load_stylesheet($stylesheet['data'], TRUE);

-        // Build the base URL of this CSS file: start with the full URL.
-        $css_base_url = file_create_url($stylesheet['data']);
-        // Move to the parent.
-        $css_base_url = substr($css_base_url, 0, strrpos($css_base_url, '/'));
-        // Simplify to a relative URL if the stylesheet URL starts with the
-        // base URL of the website.
-        if (substr($css_base_url, 0, strlen($GLOBALS['base_root'])) == $GLOBALS['base_root']) {
-          $css_base_url = substr($css_base_url, strlen($GLOBALS['base_root']));
-        }
+        // Get the parent directory of this file, relative to the Drupal root.
+        $css_base_url = substr($stylesheet['data'], 0, strrpos($stylesheet['data'], '/'));

         _drupal_build_css_path(NULL, $css_base_url . '/');
         // Anchor all paths in the CSS with its base URL, ignoring external and absolute paths.
@@ -3632,7 +3625,7 @@ function _drupal_build_css_path($matches, $base = NULL) {
     $last = $path;
     $path = preg_replace('`(^|/)(?!\.\./)([^/]+)/\.\./`', '$1', $path);
   }
-  return 'url(' . $path . ')';
+  return 'url(' . file_create_url($path) . ')';
 }

 /**

