Skip to content

Commit 5dbc22e

Browse files
dariskamilwylegala
authored andcommitted
Fixed deprecation warning when parsing parameters in ShellDispatcher.php
PHP Deprecated: strpos(): Passing null to parameter kamilwylegala#1 ($haystack) of type string is deprecated in lib/Cake/Console/ShellDispatcher.php on line 295 It broke some behat tests for my project because PHP issued warning and then session has not been able to start correctly due to "Session cannot be started after headers have already been sent" error
1 parent b0200a7 commit 5dbc22e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/Cake/Console/ShellDispatcher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public function parseParams($args) {
292292
$params = array_merge($defaults, array_intersect_key($this->params, $defaults));
293293
$isWin = false;
294294
foreach ($defaults as $default => $value) {
295-
if (strpos($params[$default], '\\') !== false) {
295+
if (!is_null($params[$default]) && strpos($params[$default], '\\') !== false) {
296296
$isWin = true;
297297
break;
298298
}

0 commit comments

Comments
 (0)