summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2013-12-27 23:51:46 -0500
committerDavid Rothstein <drothstein@gmail.com>2013-12-27 23:51:46 -0500
commit16fe2e9d8c32a5d95e231fefa1b96f3a107f7b7c (patch)
treed30522e5612db6d9273f1e46ad0c7ef0749e135a /includes/common.inc
parent97ba84ca650f6bb868e5ba420d813392fa94b318 (diff)
downloadbrdo-16fe2e9d8c32a5d95e231fefa1b96f3a107f7b7c.tar.gz
brdo-16fe2e9d8c32a5d95e231fefa1b96f3a107f7b7c.tar.bz2
Issue #1198904 by das-peter, jox: Drupal_load_stylesheet() fails to load @import files in different directories.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 903409531..9cd73f4e2 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3673,17 +3673,23 @@ function drupal_load_stylesheet($file, $optimize = NULL, $reset_basepath = TRUE)
if ($basepath && !file_uri_scheme($file)) {
$file = $basepath . '/' . $file;
}
+ // Store the parent base path to restore it later.
+ $parent_base_path = $basepath;
+ // Set the current base path to process possible child imports.
$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.
+ $content = '';
if ($contents = @file_get_contents($file)) {
// Return the processed stylesheet.
- return drupal_load_stylesheet_content($contents, $_optimize);
+ $content = drupal_load_stylesheet_content($contents, $_optimize);
}
- return '';
+ // Restore the parent base path as the file and its childen are processed.
+ $basepath = $parent_base_path;
+ return $content;
}
/**