diff options
author | Tyler Antonio <tantonio@ualberta.ca> | 2016-11-09 15:56:08 -0700 |
---|---|---|
committer | Tyler Antonio <tantonio@ualberta.ca> | 2016-11-09 15:56:08 -0700 |
commit | 1ce9a0cd64a16f09103cadf024f2af2a522f9637 (patch) | |
tree | 13c89d2a94c7d5e7b344a7f819f5240d772a5031 | |
parent | 6e3322250a412f6b24538c59e3d8d42091e6df5c (diff) | |
download | simplesamlphp-1ce9a0cd64a16f09103cadf024f2af2a522f9637.zip simplesamlphp-1ce9a0cd64a16f09103cadf024f2af2a522f9637.tar.gz simplesamlphp-1ce9a0cd64a16f09103cadf024f2af2a522f9637.tar.bz2 |
Use count() instead of empty().
Cannot provide array_filter() output directly to empty() in conditional in PHP <= 5.4.
-rw-r--r-- | lib/SimpleSAML/Utils/Config/Metadata.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php index 297cae3..9b58679 100644 --- a/lib/SimpleSAML/Utils/Config/Metadata.php +++ b/lib/SimpleSAML/Utils/Config/Metadata.php @@ -117,7 +117,7 @@ class Metadata // check attributes is an associative array if (isset($contact['attributes'])) { - if (empty($contact['attributes']) || !is_array($contact['attributes']) || empty(array_filter(array_keys($contact['attributes']), 'is_string'))) { + if (empty($contact['attributes']) || !is_array($contact['attributes']) || count(array_filter(array_keys($contact['attributes']), 'is_string')) == 0) { throw new \InvalidArgumentException('"attributes" must be an array and cannot be empty.'); } } |