From: Roan Kattouw Date: Thu, 15 Nov 2018 01:08:45 +0000 (-0800) Subject: EditPage: Add returntoquery parameter to anoneditwarning links X-Git-Tag: 1.34.0-rc.0~3501^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=6d4b92f930d8e06c74114ced1a27ff33e4e26a28;p=lhc%2Fweb%2Fwiklou.git EditPage: Add returntoquery parameter to anoneditwarning links It's important to send people back not just to the page they were editing, but to the actual edit action as well. Bug: T208989 Change-Id: I010145840da1ac93927db846872eaf9843116bd7 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 373f6d9bf6..1f17297c58 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3145,16 +3145,22 @@ ERROR; ); } elseif ( $user->isAnon() ) { if ( $this->formtype != 'preview' ) { + $returntoquery = array_diff_key( + $this->context->getRequest()->getValues(), + [ 'title' => true, 'returnto' => true, 'returntoquery' => true ] + ); $out->wrapWikiMsg( "
\n$1\n
", [ 'anoneditwarning', // Log-in link SpecialPage::getTitleFor( 'Userlogin' )->getFullURL( [ - 'returnto' => $this->getTitle()->getPrefixedDBkey() + 'returnto' => $this->getTitle()->getPrefixedDBkey(), + 'returntoquery' => wfArrayToCgi( $returntoquery ), ] ), // Sign-up link SpecialPage::getTitleFor( 'CreateAccount' )->getFullURL( [ - 'returnto' => $this->getTitle()->getPrefixedDBkey() + 'returnto' => $this->getTitle()->getPrefixedDBkey(), + 'returntoquery' => wfArrayToCgi( $returntoquery ), ] ) ] );