Merge pull request #4165 from MrPetovan/bug/4163-null-profile

Remove too strict parameter check in defaults()
This commit is contained in:
Michael Vogel 2018-01-04 09:58:27 +01:00 committed by GitHub
commit 00d369a65d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -595,9 +595,6 @@ function defaults() {
if (count($args) > 3) {
throw new BadFunctionCallException('defaults() cannot use more than 3 parameters');
}
if (count($args) === 3 && !is_array($args[0])) {
throw new BadFunctionCallException('defaults($arr, $key, $def) requires an array as first parameter');
}
if (count($args) === 3 && is_null($args[1])) {
throw new BadFunctionCallException('defaults($arr, $key, $def) $key is null');
}