diff options
-rw-r--r-- | engine/lib/elgglib.php | 14 | ||||
-rw-r--r-- | engine/lib/metadata.php | 5 |
2 files changed, 17 insertions, 2 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 356ecd003..5ee17c486 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1861,6 +1861,20 @@ } /** + * Function to be used in array_filter which returns true if $string is not null. + * + * @param string $string + * @return bool + */ + function is_not_null($string) + { + if (($string==='') || ($string===false) || ($string===null)) + return false; + + return true; + } + + /** * Get the full URL of the current page. * * @return string The URL diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 481fdda16..97d81e973 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -753,8 +753,9 @@ if (is_string($string)) {
$ar = explode(",",$string); - $ar = array_map('trim', $ar); - $ar = array_map('strtolower', $ar);
+ $ar = array_map('trim', $ar); // trim blank spaces + $ar = array_map('strtolower', $ar); // make lower case + $ar = array_filter($ar, 'is_not_null'); // Remove null values
return $ar;
}
return false;
|