aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-22 15:29:24 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-22 15:29:24 +0000
commit7fb95f609a42da3964188b8093d0b66e439e33d0 (patch)
tree5288c40ea5ed9b4fa76574e1032d20bb093b791a /engine/lib
parent2f6790702c0a15e664c2d7e607c229025ecdbbaf (diff)
downloadelgg-7fb95f609a42da3964188b8093d0b66e439e33d0.tar.gz
elgg-7fb95f609a42da3964188b8093d0b66e439e33d0.tar.bz2
Closes #701: Blank tags not returned by string_to_tag_array
git-svn-id: https://code.elgg.org/elgg/trunk@2597 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/elgglib.php14
-rw-r--r--engine/lib/metadata.php5
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;