From d62e5e1b00bea33df3240d40a06143018724cf22 Mon Sep 17 00:00:00 2001 From: Harold Putman Date: Thu, 24 Apr 2014 09:25:00 -0400 Subject: [PATCH] Prevent infinite loop caused when argv not set. If shell is invoked with the wrong PHP executable (not CLI) and argv is not an array, array_search on null causes infinite number of error messages. --- lib/Cake/Console/ShellDispatcher.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index ba4479f20..c61be883a 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -323,6 +323,7 @@ class ShellDispatcher { protected function _parsePaths($args) { $parsed = array(); $keys = array('-working', '--working', '-app', '--app', '-root', '--root'); + $args = (array)$args; foreach ($keys as $key) { while (($index = array_search($key, $args)) !== false) { $keyname = str_replace('-', '', $key);