From 488624675c01118d72beeb16d2879edccf2e3cac Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 24 Nov 2012 16:13:35 +0100 Subject: [PATCH] Prevent exception when glob fails to return an array, fixes #1357 --- src/Composer/Factory.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index da468f2bd..911805dce 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -100,8 +100,10 @@ class Factory continue; } } - foreach (glob($oldPathMatch) as $child) { - @rename($child, $dir.'/'.basename($child)); + if (is_array($children = glob($oldPathMatch))) { + foreach ($children as $child) { + @rename($child, $dir.'/'.basename($child)); + } } @unlink($oldPath); }