* (bug 1368) Fix SQL error on stopword/short word search w/ MySQL 3.x
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 28 Jan 2005 00:35:23 +0000 (00:35 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 28 Jan 2005 00:35:23 +0000 (00:35 +0000)
includes/SearchMySQL3.php

index d6b1b7e..bd2a0ed 100644 (file)
@@ -72,7 +72,9 @@ class SearchMySQL3 extends SearchEngine {
                        }
                }
                if ( 0 == count( $this->searchTerms ) ) {
-                       return null;
+                       # No searchable terms remaining.
+                       # We have to return a term for the query or we get an SQL error.
+                       return "0";
                }
 
                return '(' . $cond . ' )';