Skip to content

Commit

Permalink
Fix fatal error in strict mode
Browse files Browse the repository at this point in the history
Fixed strlen() issue when it receives null value in strict mode.
  • Loading branch information
aokhrimenko authored and jordisala1991 committed Mar 2, 2018
1 parent 482ec8b commit 7bfe01d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,9 @@ private function replaceDefaultArguments(

foreach ($defaultArguments as $index => $value) {
$declaredInParent = $parentDefinition && array_key_exists($index, $parentArguments);
$argumentValue = $declaredInParent ? $parentArguments[$index] : $arguments[$index];

if (0 == strlen($declaredInParent ? $parentArguments[$index] : $arguments[$index])) {
if (null === $argumentValue || 0 === strlen($argumentValue)) {
$arguments[$declaredInParent ? sprintf('index_%s', $index) : $index] = $value;
}
}
Expand Down

0 comments on commit 7bfe01d

Please sign in to comment.