diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-08-23 19:06:15 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-08-23 19:06:15 +0200 |
commit | 9f754494e74396469ff6ceb34ece25b088756ffa (patch) | |
tree | eb0c0915902b2e1cfa0b7c6f9760178ffc891279 /program | |
parent | 8880e37f8faf124e6b7f694a8b09f9c5119131eb (diff) |
Fix unquoted path in PREG expression on Windows (#1489290)
Diffstat (limited to 'program')
-rw-r--r-- | program/lib/Roundcube/bootstrap.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 3f4d2c387..5d5a22387 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -84,10 +84,13 @@ if (extension_loaded('mbstring')) { } // make sure the Roundcube lib directory is in the include_path -$rcube_include_path = realpath(RCUBE_LIB_DIR . '..'); -$sep = PATH_SEPARATOR; -if (!preg_match("!(^|$sep)$rcube_include_path($sep|\$)!", ini_get('include_path'))) { - set_include_path(ini_get('include_path') . PATH_SEPARATOR . $rcube_include_path); +$rcube_path = realpath(RCUBE_LIB_DIR . '..'); +$sep = PATH_SEPARATOR; +$regexp = "!(^|$sep)" . preg_quote($rcube_path, '!') . "($sep|\$)!"; +$path = ini_get('include_path'); + +if (!preg_match($regexp, $path)) { + set_include_path($path . PATH_SEPARATOR . $rcube_path); } // Register autoloader |