From c554a12be0d07917d301173410b6086ba316869a Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 14 Mar 2011 12:44:58 +0000 Subject: [PATCH] hacky fix for searching, make sure query variables are unique --- core/imageboard.pack.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index 617d81e3..57bf6cff 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -23,6 +23,8 @@ * Classes * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +$tag_n = 0; // temp hack + /** * An object representing an entry in the images table. As of 2.2, this no * longer necessarily represents an image per se, but could be a video, @@ -730,9 +732,11 @@ class Image { $sql = "0"; $terms = array(); foreach($tag_querylets as $tq) { + global $tag_n; $sign = $tq->positive ? "+" : "-"; - $sql .= " $sign (tag LIKE :tag)"; - $terms["tag"] = $tq->tag; + $sql .= " $sign (tag LIKE :tag$tag_n)"; + $terms["tag$tag_n"] = $tq->tag; + $tag_n++; if($sign == "+") $positive_tag_count++; else $negative_tag_count++;