diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-08-21 20:51:26 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-08-21 20:51:26 +0000 |
commit | 64aafb5ca73d329663a93f80ac9cf3e68a082866 (patch) | |
tree | f6462c3112d26aea2ad09cdb76b38abb74183757 /engine/lib/elgglib.php | |
parent | c3cbea030adb2201e29897915bfae19f1628c967 (diff) | |
download | elgg-64aafb5ca73d329663a93f80ac9cf3e68a082866.tar.gz elgg-64aafb5ca73d329663a93f80ac9cf3e68a082866.tar.bz2 |
Merged r6534-6559 from 1.7 branch to trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6840 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r-- | engine/lib/elgglib.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index f74fbec09..3d08227e4 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1624,22 +1624,15 @@ function is_not_null($string) { function elgg_normalise_plural_options_array($options, $singulars) { foreach ($singulars as $singular) { $plural = $singular . 's'; - - // normalize the singular to plural - // isset() returns FALSE for array values of NULL, so they are ignored. - // everything else falsy is included. - //if (isset($options[$singular]) && $options[$singular] !== NULL && $options[$singular] !== FALSE) { - if (isset($options[$singular])) { - if (isset($options[$plural])) { - if (is_array($options[$plural])) { - $options[$plural][] = $options[$singlar]; - } else { - $options[$plural] = array($options[$plural], $options[$singular]); - } + + if (array_key_exists($singular, $options)) { + if ($options[$singular] === ELGG_ENTITIES_ANY_VALUE) { + $options[$plural] = $options[$singular]; } else { $options[$plural] = array($options[$singular]); } } + unset($options[$singular]); } |