diff --git a/core/includes/common.inc b/core/includes/common.inc index 9da67ac..b83232c 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3510,9 +3510,10 @@ function _drupal_build_css_path($matches, $base = NULL) { */ function drupal_load_stylesheet($file, $optimize = NULL, $reset_basepath = TRUE) { // These statics are not cache variables, so we don't use drupal_static(). - static $_optimize, $basepath; + static $_optimize, $basepath, $basepath_stack; if ($reset_basepath) { $basepath = ''; + $basepath_stack = array(); } // Store the value of $optimize for preg_replace_callback with nested // @import loops. @@ -3525,17 +3526,19 @@ function drupal_load_stylesheet($file, $optimize = NULL, $reset_basepath = TRUE) if ($basepath && !file_uri_scheme($file)) { $file = $basepath . '/' . $file; } + array_push($basepath_stack, $basepath); $basepath = dirname($file); // Load the CSS stylesheet. We suppress errors because themes may specify // stylesheets in their .info file that don't exist in the theme's path, // but are merely there to disable certain module CSS files. + $result = ''; if ($contents = @file_get_contents($file)) { // Return the processed stylesheet. - return drupal_load_stylesheet_content($contents, $_optimize); + $result = drupal_load_stylesheet_content($contents, $_optimize); } - - return ''; + $basepath = array_pop($basepath_stack); + return $result; } /**