Ver Fonte

Add the P character to the regex pattern

According to http://php.net/manual/en/function.preg-match.php and some other sources named groups should contain a 'P' character after the '?'

Without this, I receive the following error when running an update:

[ErrorException]
  preg_match(): Compilation failed: unrecognized character after (?< at offset 4

Exception trace:
 () at phar:///var/www/git/smmqa/app/admin/composer.phar/src/Composer/Package/Version/VersionParser.php:181
Chris Brand há 10 anos atrás
pai
commit
87b7de4d0a
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      src/Composer/Package/Version/VersionParser.php

+ 1 - 1
src/Composer/Package/Version/VersionParser.php

@@ -178,7 +178,7 @@ class VersionParser
      */
      */
     public function parseNumericAliasPrefix($branch)
     public function parseNumericAliasPrefix($branch)
     {
     {
-        if (preg_match('/^(?<version>(\d+\\.)*\d+)(?:\.x)?-dev$/i', $branch, $matches)) {
+        if (preg_match('/^(?P<version>(\d+\\.)*\d+)(?:\.x)?-dev$/i', $branch, $matches)) {
             return $matches['version'].".";
             return $matches['version'].".";
         }
         }