+ if ( $redirect === null ) {
+ // The user input is empty or an invalid title,
+ // redirect to form of Special:Redirect with the invalid value prefilled
+ $this->mAddedRedirectParams['wpvalue'] = $file;
+ $redirect = SpecialPage::getSafeTitleFor( 'Redirect', 'file' );
+ }
+ return $redirect;