Jordi Boggiano 5 лет назад
Родитель
Сommit
fbb964888d

+ 5 - 5
composer.lock

@@ -186,16 +186,16 @@
         },
         {
             "name": "composer/xdebug-handler",
-            "version": "1.3.2",
+            "version": "1.3.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/xdebug-handler.git",
-                "reference": "d17708133b6c276d6e42ef887a877866b909d892"
+                "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892",
-                "reference": "d17708133b6c276d6e42ef887a877866b909d892",
+                "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f",
+                "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f",
                 "shasum": ""
             },
             "require": {
@@ -226,7 +226,7 @@
                 "Xdebug",
                 "performance"
             ],
-            "time": "2019-01-28T20:25:53+00:00"
+            "time": "2019-05-27T17:52:04+00:00"
         },
         {
             "name": "justinrainbow/json-schema",

+ 3 - 1
src/Composer/Command/CreateProjectCommand.php

@@ -184,7 +184,9 @@ EOT
                 ->setRunScripts(!$noScripts)
                 ->setIgnorePlatformRequirements($ignorePlatformReqs)
                 ->setSuggestedPackagesReporter($this->suggestedPackagesReporter)
-                ->setOptimizeAutoloader($config->get('optimize-autoloader'));
+                ->setOptimizeAutoloader($config->get('optimize-autoloader'))
+                ->setClassMapAuthoritative($config->get('classmap-authoritative'))
+                ->setApcuAutoloader($config->get('apcu-autoloader'));
 
             if ($disablePlugins) {
                 $installer->disablePlugins();

+ 1 - 1
src/Composer/Json/JsonManipulator.php

@@ -22,7 +22,7 @@ class JsonManipulator
     private static $DEFINES = '(?(DEFINE)
        (?<number>   -? (?= [1-9]|0(?!\d) ) \d+ (\.\d+)? ([eE] [+-]? \d+)? )
        (?<boolean>   true | false | null )
-       (?<string>    " ([^"\\\\]* | \\\\ ["\\\\bfnrt\/] | \\\\ u [0-9a-f]{4} )* " )
+       (?<string>    " ([^"\\\\]* | \\\\ ["\\\\bfnrt\/] | \\\\ u [0-9A-Fa-f]{4} )* " )
        (?<array>     \[  (?:  (?&json) \s* (?: , (?&json) \s* )*  )?  \s* \] )
        (?<pair>      \s* (?&string) \s* : (?&json) \s* )
        (?<object>    \{  (?:  (?&pair)  (?: , (?&pair)  )*  )?  \s* \} )

+ 7 - 0
src/Composer/Repository/Vcs/BitbucketDriver.php

@@ -218,6 +218,13 @@ abstract class BitbucketDriver extends VcsDriver
             return $this->fallbackDriver->getChangeDate($identifier);
         }
 
+        if (strpos($identifier, '/') !== false) {
+            $branches = $this->getBranches();
+            if (isset($branches[$identifier])) {
+                $identifier = $branches[$identifier];
+            }
+        }
+
         $resource = sprintf(
             'https://api.bitbucket.org/2.0/repositories/%s/%s/commit/%s?fields=date',
             $this->owner,

+ 20 - 0
tests/Composer/Test/Json/JsonManipulatorTest.php

@@ -2374,6 +2374,26 @@ class JsonManipulatorTest extends TestCase
         "package/a": "*"
     }
 }
+', $manipulator->getContents());
+    }
+
+    public function testEscapedUnicodeDoesNotCauseBacktrackLimitErrorGithubIssue8131()
+    {
+        $manipulator = new JsonManipulator('{
+  "description": "Some U\u00F1icode",
+  "require": {
+    "foo/bar": "^1.0"
+  }
+}');
+
+        $this->assertTrue($manipulator->addLink('require', 'foo/baz', '^1.0'));
+        $this->assertEquals('{
+  "description": "Some U\u00F1icode",
+  "require": {
+    "foo/bar": "^1.0",
+    "foo/baz": "^1.0"
+  }
+}
 ', $manipulator->getContents());
     }
 }