1
0
Fork 0

Fix updir regex matching, refs #4607

pull/4616/head
Jordi Boggiano 2015-11-14 15:44:30 +00:00
parent f674261b96
commit 6f29df01d2
1 changed files with 3 additions and 1 deletions

View File

@ -697,9 +697,11 @@ FOOTER;
// add support for wildcards * and ** // add support for wildcards * and **
$path = str_replace('\\*\\*', '.+?', $path); $path = str_replace('\\*\\*', '.+?', $path);
$path = str_replace('\\*', '[^/]+?', $path); $path = str_replace('\\*', '[^/]+?', $path);
// add support for up-level relative paths // add support for up-level relative paths
$updir = null;
$path = preg_replace_callback( $path = preg_replace_callback(
'{^((\\\.{1,2})+)/}', '{^((?:(?:\\\\\\.){1,2}+/)+)}',
function ($matches) use (&$updir) { function ($matches) use (&$updir) {
if (isset($matches[1])) { if (isset($matches[1])) {
// undo preg_quote for the matched string // undo preg_quote for the matched string