Browse Source

Simplify regex pattern

Jordi Boggiano 12 năm trước cách đây
mục cha
commit
4c35f54356
1 tập tin đã thay đổi với 1 bổ sung4 xóa
  1. 1 4
      src/Composer/Command/InitCommand.php

+ 1 - 4
src/Composer/Command/InitCommand.php

@@ -429,10 +429,7 @@ EOT
             return false;
         }
 
-        $pattern = sprintf(
-            '~^/?%s(/|/\*)?$~',
-            preg_quote($vendor, '~')
-        );
+        $pattern = sprintf('{^/?%s(/\*?)?$}', preg_quote($vendor));
 
         $lines = file($ignoreFile, FILE_IGNORE_NEW_LINES);
         foreach ($lines as $line) {