// Bind to member variable
$this->opts = $opts;
- $this->target = Title::newFromURL( $opts->getValue( 'target' ) );
+ $this->target = Title::newFromText( $opts->getValue( 'target' ) );
if ( !$this->target ) {
if ( !$this->including() ) {
$out->addHTML( $this->whatlinkshereForm() );
$f .= ' ';
# Submit
- $f .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() );
+ $f .= Xml::submitButton( $this->msg( 'whatlinkshere-submit' )->text() );
# Close
$f .= Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ) . "\n";
* @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