mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
a3ad1c859f
commit
d62e5e1b00
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue