X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPrefixSearch.php;h=430b4b8972d5d7259059f2f1d5a08cea99a1f3f8;hb=6a8c8342069ee0fd95dc14f29b64324921af6345;hp=2885679c4706cd046622e3ba3863ecc8c1712e83;hpb=53ebdc8a18e1252525c41a4c45df12e875ef887f;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',