summaryrefslogtreecommitdiff
path: root/lib/exe/css.php
diff options
context:
space:
mode:
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
*