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.
This commit is contained in:
Harold Putman 2014-04-24 09:25:00 -04:00
parent a3ad1c859f
commit d62e5e1b00

View file

@ -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);