summaryrefslogtreecommitdiff
path: root/modules/pref-labels.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pref-labels.php')
-rw-r--r--modules/pref-labels.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/pref-labels.php b/modules/pref-labels.php
index 165765b89..336228801 100644
--- a/modules/pref-labels.php
+++ b/modules/pref-labels.php
@@ -138,7 +138,19 @@
value=\"".__('Create label')."\"></div>";
if ($label_search) {
- $label_search_query = "caption LIKE '%$label_search%' AND";
+
+ $label_search = split(" ", $label_search);
+ $tokens = array();
+
+ foreach ($label_search as $token) {
+
+ $token = trim($token);
+ array_push($tokens, "(UPPER(caption) LIKE UPPER('%$token%'))");
+
+ }
+
+ $label_search_query = "(" . join($tokens, " AND ") . ") AND ";
+
} else {
$label_search_query = "";
}