Remove WMF deployment hack for .feedlink from mediawiki.legacy.shared
[lhc/web/wiklou.git] / includes / PrefixSearch.php
index caa3ef5..430b4b8 100644 (file)
@@ -95,7 +95,6 @@ abstract class PrefixSearch {
         * @return array
         */
        public function searchWithVariants( $search, $limit, array $namespaces, $offset = 0 ) {
-               wfProfileIn( __METHOD__ );
                $searches = $this->search( $search, $limit, $namespaces, $offset );
 
                // if the content language has variants, try to retrieve fallback results
@@ -116,7 +115,6 @@ abstract class PrefixSearch {
                                }
                        }
                }
-               wfProfileOut( __METHOD__ );
                return $searches;
        }
 
@@ -157,7 +155,10 @@ abstract class PrefixSearch {
                        }
                }
                $srchres = array();
-               if ( Hooks::run( 'PrefixSearchBackend', array( $namespaces, $search, $limit, &$srchres, $offset ) ) ) {
+               if ( Hooks::run(
+                       'PrefixSearchBackend',
+                       array( $namespaces, $search, $limit, &$srchres, $offset )
+               ) ) {
                        return $this->titles( $this->defaultSearchBackend( $namespaces, $search, $limit, $offset ) );
                }
                return $this->strings( $this->handleResultFromHook( $srchres, $namespaces, $search, $limit ) );
@@ -361,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',