summaryrefslogtreecommitdiff
path: root/lib/exe/css.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-02-02 17:52:32 +0100
committerAndreas Gohr <andi@splitbrain.org>2014-02-02 17:52:32 +0100
commit73f25ac04a7caaa8cdb07bfc71e807f46f227f97 (patch)
treeae7906d95345d85c37e07fe49cf4e0af95507b7f /lib/exe/css.php
parentad5be2d08559b834f85255bc802b4a6a6887af6b (diff)
downloadrpg-73f25ac04a7caaa8cdb07bfc71e807f46f227f97.tar.gz
rpg-73f25ac04a7caaa8cdb07bfc71e807f46f227f97.tar.bz2
fix error on CSS includes on windows
The regex wasn't properly escaped here which lead to problems when the path contains backslashes. This is the root cause of the bug reported at https://github.com/cosmocode/edittable/issues/19
Diffstat (limited to 'lib/exe/css.php')
-rw-r--r--lib/exe/css.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index c96dedd37..f273b7ee4 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -456,8 +456,9 @@ class DokuCssFile {
if (defined('DOKU_UNITTEST')) {
$basedir[] = realpath(TMP_DIR);
}
- $regex = '#^('.join('|',$basedir).')#';
+ $basedir = array_map('preg_quote_cb', $basedir);
+ $regex = '/^('.join('|',$basedir).')/';
$this->relative_path = preg_replace($regex, '', dirname($this->filepath));
}