From 6f29df01d27cfed3d320ad97543ec81ac6e6a08e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 14 Nov 2015 15:44:30 +0000 Subject: [PATCH] Fix updir regex matching, refs #4607 --- src/Composer/Autoload/AutoloadGenerator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index db8bcae58..d2384cd0f 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -697,9 +697,11 @@ FOOTER; // add support for wildcards * and ** $path = str_replace('\\*\\*', '.+?', $path); $path = str_replace('\\*', '[^/]+?', $path); + // add support for up-level relative paths + $updir = null; $path = preg_replace_callback( - '{^((\\\.{1,2})+)/}', + '{^((?:(?:\\\\\\.){1,2}+/)+)}', function ($matches) use (&$updir) { if (isset($matches[1])) { // undo preg_quote for the matched string