EditPage: Do not resolve redirect on cancel button
[lhc/web/wiklou.git] / includes / EditPage.php
index 02093ff..f2403fe 100644 (file)
@@ -2833,9 +2833,14 @@ class EditPage {
                                        "<div id='mw-anon-edit-warning' class='warningbox'>\n$1\n</div>",
                                        [ 'anoneditwarning',
                                                // Log-in link
-                                               '{{fullurl:Special:UserLogin|returnto={{FULLPAGENAMEE}}}}',
+                                               SpecialPage::getTitleFor( 'Userlogin' )->getFullURL( [
+                                                       'returnto' => $this->getTitle()->getPrefixedDBkey()
+                                               ] ),
                                                // Sign-up link
-                                               '{{fullurl:Special:UserLogin/signup|returnto={{FULLPAGENAMEE}}}}' ]
+                                               SpecialPage::getTitleFor( 'CreateAccount' )->getFullURL( [
+                                                       'returnto' => $this->getTitle()->getPrefixedDBkey()
+                                               ] )
+                                       ]
                                );
                        } else {
                                $wgOut->wrapWikiMsg( "<div id=\"mw-anon-preview-warning\" class=\"warningbox\">\n$1</div>",
@@ -3496,6 +3501,8 @@ HTML
                $cancelParams = [];
                if ( !$this->isConflict && $this->oldid > 0 ) {
                        $cancelParams['oldid'] = $this->oldid;
+               } elseif ( $this->getContextTitle()->isRedirect() ) {
+                       $cancelParams['redirect'] = 'no';
                }
                $attrs = [ 'id' => 'mw-editform-cancel' ];
 
@@ -3860,7 +3867,7 @@ HTML
                        ],
                        $showSignature ? [
                                'id'     => 'mw-editbutton-signature',
-                               'open'   => '--~~~~',
+                               'open'   => wfMessage( 'sig-text', '~~~~' )->inContentLanguage()->text(),
                                'close'  => '',
                                'sample' => '',
                                'tip'    => wfMessage( 'sig_tip' )->text(),