If you visit `Special:MyPage?action=edit&redlink=1` and your user page
exists, this would redirect to `User:Yourname?action=edit&redlink=1`,
which then would redirect further to `User:Yourname`. Just redirect
there directly.
Additionally, the double-redirect seems to somehow conflict with the
fake-redirect code for $wgHideIdentifiableRedirects. I couldn't figure
out why this happens, but you end up on a blank page and no redirect
of either kind occurs.
Bug: T229794
Change-Id: I952fc9df91b1243db22f956ec09bee457c8a21bf
Hooks::run( "RedirectSpecialArticleRedirectParams", [ &$redirectParams ] );
$this->mAllowedRedirectParams = $redirectParams;
}
+
+ /**
+ * @inheritDoc
+ */
+ public function getRedirectQuery( $subpage ) {
+ $query = parent::getRedirectQuery( $subpage );
+ $title = $this->getRedirect( $subpage );
+ // Avoid double redirect for action=edit&redlink=1 for existing pages
+ // (compare to the check in EditPage::edit)
+ if (
+ $query &&
+ ( $query['action'] === 'edit' || $query['action'] === 'submit' ) &&
+ (bool)$query['redlink'] &&
+ $title instanceof Title &&
+ $title->exists()
+ ) {
+ return false;
+ }
+ return $query;
+ }
+
}