X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPrefixSearch.php;h=430b4b8972d5d7259059f2f1d5a08cea99a1f3f8;hb=c7b932af6bbcb380cf250d5e3d7cd480514ef747;hp=2885679c4706cd046622e3ba3863ecc8c1712e83;hpb=1e209d1e74cf2c0f5f78a3ca8014fc0af9d7f0a5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/PrefixSearch.php b/includes/PrefixSearch.php index 2885679c47..430b4b8972 100644 --- a/includes/PrefixSearch.php +++ b/includes/PrefixSearch.php @@ -155,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 ) ); @@ -359,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',