Skip to content
Browse files

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.
  • Loading branch information...
HaroldPutman committed Apr 24, 2014
1 parent a3ad1c8 commit d62e5e1b00bea33df3240d40a06143018724cf22
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/Cake/Console/ShellDispatcher.php
@@ -323,6 +323,7 @@ public function parseParams($args) {
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);

0 comments on commit d62e5e1

Please sign in to comment.
You can’t perform that action at this time.