summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Stein2011-05-26 13:27:26 (GMT)
committerJoel Stein2011-05-26 13:27:26 (GMT)
commit0fd70d6e021f7e8bd98f9b6b2f97b3e61c83b59b (patch)
tree3bfacb1c779ca6f1fcc3a334808863cf851005b5
parentdb14b44c9820df3aa91df8ccd1fd9ba80dcd6463 (diff)
Fixed bug causing URLs to not include the base path; fixed bug where CSS paths including '../' weren't resolving properly.
-rwxr-xr-xskin.module8
1 files changed, 4 insertions, 4 deletions
diff --git a/skin.module b/skin.module
index f127a7f..2682466 100755
--- a/skin.module
+++ b/skin.module
@@ -56,8 +56,8 @@ function skin_exit() {
*
* $matches[0] - entire match (including quotes)
* $matches[1] - entire url (no quotes)
- * $matches[2] - base url (http://example.com)
- * $matches[3] - base url and base path (http://example.com/)
+ * $matches[2] - base url and base path (http://example.com/)
+ * $matches[3] - base url (http://example.com)
* $matches[4] - path to css/js file (modules/system/system.base.css)
* $matches[5] - extension (css or js)
* $matches[6] - query string (empty for optimized files)
@@ -82,9 +82,9 @@ function _skin_replace_callback($matches) {
// See drupal_build_css_cache().
else {
$contents = drupal_load_stylesheet($matches[4]);
- $base = $matches[3] . dirname($matches[4]);
+ $base = $matches[2] . dirname($matches[4]) . '/';
_drupal_build_css_path(NULL, $base);
- $contents = preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', '_drupal_build_css_path', $contents);
+ $contents = preg_replace_callback('/url\(\s*[\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\s*\)/i', '_drupal_build_css_path', $contents);
}
if (file_save_data($contents, $skin_uri, FILE_EXISTS_REPLACE)) {
$uri = $skin_uri;