summaryrefslogtreecommitdiff
path: root/lib/exe/css.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2013-11-12 23:37:38 +0000
committerChristopher Smith <chris@jalakai.co.uk>2013-11-12 23:37:38 +0000
commit47f862d1e038979f4d2dd5bb0c3eaaa9d1ee8fee (patch)
tree49300cca7342482d59a6cfc2152d11430cd8b4af /lib/exe/css.php
parentcfe186a5905005f882e870f5af79b31d53dd04ae (diff)
downloadrpg-47f862d1e038979f4d2dd5bb0c3eaaa9d1ee8fee.tar.gz
rpg-47f862d1e038979f4d2dd5bb0c3eaaa9d1ee8fee.tar.bz2
Fix an issue with style.ini replacements values not having relative
locations corrected, when those values are "url(...)". Explanation: In the change to the less css extension, variable replacements now happen after the less/css files are processed for correction of relative locations.
Diffstat (limited to 'lib/exe/css.php')
-rw-r--r--lib/exe/css.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index f0bd24b43..af7f9e4f1 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -271,7 +271,7 @@ function css_styleini($tpl) {
// replacements
if(is_array($data['replacements'])){
- $replacements = array_merge($replacements, $data['replacements']);
+ $replacements = array_merge($replacements, css_fixreplacementurls($data['replacements'],$webbase));
}
}
@@ -288,7 +288,7 @@ function css_styleini($tpl) {
// replacements
if(is_array($data['replacements'])){
- $replacements = array_merge($replacements, $data['replacements']);
+ $replacements = array_merge($replacements, css_fixreplacementurls($data['replacements'],$webbase));
}
}
@@ -306,7 +306,7 @@ function css_styleini($tpl) {
// replacements
if(is_array($data['replacements'])){
- $replacements = array_merge($replacements, $data['replacements']);
+ $replacements = array_merge($replacements, css_fixreplacementurls($data['replacements'],$webbase));
}
}
@@ -316,6 +316,13 @@ function css_styleini($tpl) {
);
}
+function css_fixreplacementurls($replacements, $location) {
+ foreach($replacements as $key => $value) {
+ $replacements[$key] = preg_replace('#(url\([ \'"]*)(?!/|data:|http://|https://| |\'|")#','\\1'.$location,$value);
+ }
+ return $replacements;
+}
+
/**
* Prints classes for interwikilinks
*