diff options
Diffstat (limited to 'lib/exe')
-rw-r--r-- | lib/exe/css.php | 13 | ||||
-rw-r--r-- | lib/exe/detail.php | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php index 9cde09545..02fc6eab7 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -277,7 +277,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)); } } @@ -294,7 +294,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)); } } @@ -312,7 +312,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)); } } @@ -322,6 +322,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 * diff --git a/lib/exe/detail.php b/lib/exe/detail.php index e3c81d877..cd3f362ad 100644 --- a/lib/exe/detail.php +++ b/lib/exe/detail.php @@ -6,7 +6,7 @@ require_once(DOKU_INC.'inc/init.php'); $IMG = getID('media'); $ID = cleanID($INPUT->str('id')); -// this makes some general infos available as well as the info about the +// this makes some general info available as well as the info about the // "parent" page $INFO = array_merge(pageinfo(),mediainfo()); |