From 73f25ac04a7caaa8cdb07bfc71e807f46f227f97 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 2 Feb 2014 17:52:32 +0100 Subject: 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 --- lib/exe/css.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/exe/css.php') 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)); } -- cgit v1.2.3