Merge "Add tests for WikiMap and WikiReference"
[lhc/web/wiklou.git] / includes / PrefixSearch.php
index 55a4f49..430b4b8 100644 (file)
@@ -362,7 +362,11 @@ abstract class PrefixSearch {
                        $ns = NS_MAIN; // if searching on many always default to main
                }
 
-               $t = Title::newFromText( $search, $ns );
+               $t = null;
+               if ( is_string( $search ) ) {
+                       $t = Title::newFromText( $search, $ns );
+               }
+
                $prefix = $t ? $t->getDBkey() : '';
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->select( 'page',