From de6547cd4b3de30dff0f2de0702e336c7be0ebe7 Mon Sep 17 00:00:00 2001 From: shish Date: Sun, 28 Oct 2007 17:08:22 +0000 Subject: [PATCH] and merge that into stable... git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.1@590 7f39781d-f577-437e-ae19-be835c7a54ca --- core/database.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/database.class.php b/core/database.class.php index 40529e82..766a8a23 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -153,10 +153,12 @@ class Database { else { $term = str_replace("*", "%", $term); $term = str_replace("?", "_", $term); - $sign = $negative ? "-" : "+"; - if($sign == "+") $positive_tag_count++; - else $negative_tag_count++; - $tag_search->append(new Querylet(" $sign (tag LIKE ?)", array($term))); + if(!preg_match("/^[%_]+$/", $term)) { + $sign = $negative ? "-" : "+"; + if($sign == "+") $positive_tag_count++; + else $negative_tag_count++; + $tag_search->append(new Querylet(" $sign (tag LIKE ?)", array($term))); + } } }