Skip to content

Commit

Permalink
Prevent infinite loop caused when argv not set.
Browse files Browse the repository at this point in the history
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 d62e5e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Cake/Console/ShellDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d62e5e1

Please sign in to comment.