From 8534ab1dad3d4c5803199a711bfbb763a7815471 Mon Sep 17 00:00:00 2001 From: thomas-gay Date: Thu, 7 Mar 2013 09:55:23 +0100 Subject: [PATCH] Fixed potential undefined index in ArrayLoader.php A source without a reference is invalid. --- src/Composer/Package/Loader/ArrayLoader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index 13bb14037..4ea170146 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/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']) ));