summaryrefslogtreecommitdiff
path: root/mod.php
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-02-12 22:48:03 +1100
committerMichael Save <savetheinternet@tinyboard.org>2012-02-12 22:48:03 +1100
commit0c9374746483d73aa216f5874ee0f6b3e9a856a7 (patch)
tree7d10b688d28f51d1818f2a1c1976db2f329a7400 /mod.php
parent10d6884ab3d60b009a083a665289e4deaccc518c (diff)
SQL error when search is by filter only (no query for post body)
Diffstat (limited to 'mod.php')
-rw-r--r--mod.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/mod.php b/mod.php
index 5f8991bf..d601ddb9 100644
--- a/mod.php
+++ b/mod.php
@@ -1056,7 +1056,9 @@
}
foreach($filters as $name => $value) {
- $like .= ' AND `' . $name . '` = '. $pdo->quote($value);
+ if(!empty($like))
+ $like .= ' AND ';
+ $like .= '`' . $name . '` = '. $pdo->quote($value);
}
$like = str_replace('%', '%%', $like);