HTMLForm: Use <button> and allow differing label and value
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index 4c79c92..aada064 100644 (file)
@@ -700,7 +700,7 @@ class SpecialUndelete extends SpecialPage {
                $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' );
@@ -1701,7 +1701,9 @@ class SpecialUndelete extends SpecialPage {
         * @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