浏览代码

Merge pull request #1671 from thomas-gay/master

Fixed potential undefined index in ArrayLoader.php
Jordi Boggiano 12 年之前
父节点
当前提交
eeaca89fee
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Composer/Package/Loader/ArrayLoader.php

+ 2 - 2
src/Composer/Package/Loader/ArrayLoader.php

@@ -72,9 +72,9 @@ class ArrayLoader implements LoaderInterface
         }
 
         if (isset($config['source'])) {
-            if (!isset($config['source']['type']) || !isset($config['source']['url'])) {
+            if (!isset($config['source']['type']) || !isset($config['source']['url']) || !isset($config['source']['reference'])) {
                 throw new \UnexpectedValueException(sprintf(
-                    "Package %s's source key should be specified as {\"type\": ..., \"url\": ...},\n%s given.",
+                    "Package %s's source key should be specified as {\"type\": ..., \"url\": ..., \"reference\": ...},\n%s given.",
                     $config['name'],
                     json_encode($config['source'])
                 ));