$this->mTargetObj = null;
if ( $this->mTarget !== null && $this->mTarget !== '' ) {
- $this->mTargetObj = Title::newFromURL( $this->mTarget );
+ $this->mTargetObj = Title::newFromText( $this->mTarget );
}
$this->mSearchPrefix = $request->getText( 'prefix' );
* @return string[] Matching subpages
*/
public function prefixSearchSubpages( $search, $limit, $offset ) {
- if ( $search === '' ) {
+ $title = Title::newFromText( $search );
+ if ( !$title || !$title->canExist() ) {
+ // No prefix suggestion in special and media namespace
return array();
}
// Autocomplete subpage the same as a normal search