PrefixSearch: Avoid passing non-strings to Title::newFromText()
We already handle the invalid title gracefully here anyway, so just rely on that behavior and just skip the Title construction bit :) Bug: T109975 Change-Id: I0dc3d91b6b4cfb97664aa6ca39c5c8f086d70db5
This commit is contained in:
parent
9c67015bd8
commit
337b1e2ecd
1 changed files with 5 additions and 1 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue