Selaa lähdekoodia

Fix updir regex matching, refs #4607

Jordi Boggiano 9 vuotta sitten
vanhempi
commit
6f29df01d2
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      src/Composer/Autoload/AutoloadGenerator.php

+ 3 - 1
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