HTMLForm: Use <button> and allow differing label and value
[lhc/web/wiklou.git] / includes / specials / SpecialWhatlinkshere.php
index 0e5ffce..47fd972 100644 (file)
@@ -72,7 +72,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                // 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() );
@@ -496,7 +496,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                $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";
@@ -548,7 +548,9 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
         * @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