* (bug 11795) Be more paranoid about confirming accept-encoding header is present
[lhc/web/wiklou.git] / includes / SpecialMovepage.php
index 1a22fbc..cfc434a 100644 (file)
@@ -12,7 +12,7 @@ function wfSpecialMovepage( $par = null ) {
 
        # Check rights
        if ( !$wgUser->isAllowed( 'move' ) ) {
-               $wgOut->showErrorPage( 'movenologin', 'movenologintext' );
+               $wgOut->showPermissionsErrorPage( array( $wgUser->isAnon() ? 'movenologintext' : 'movenotallowed' ) );
                return;
        }
 
@@ -266,27 +266,38 @@ class MovePageForm {
        }
 
        function showSuccess() {
-               global $wgOut, $wgRequest, $wgRawHtml;
+               global $wgOut, $wgRequest, $wgUser;
+               
+               $old = Title::newFromText( $wgRequest->getVal( 'oldtitle' ) );
+               $new = Title::newFromText( $wgRequest->getVal( 'newtitle' ) );
+               
+               if( is_null( $old ) || is_null( $new ) ) {
+                       throw new ErrorPageError( 'badtitle', 'badtitletext' );
+               }
                
                $wgOut->setPagetitle( wfMsg( 'movepage' ) );
                $wgOut->setSubtitle( wfMsg( 'pagemovedsub' ) );
 
-               $oldText = wfEscapeWikiText( $wgRequest->getVal('oldtitle') );
-               $newText = wfEscapeWikiText( $wgRequest->getVal('newtitle') );
-               $talkmoved = $wgRequest->getVal('talkmoved');
+               $talkmoved = $wgRequest->getVal( 'talkmoved' );
+               $oldUrl = $old->getFullUrl( 'redirect=no' );
+               $newUrl = $new->getFullURl();
+               $oldText = $old->getPrefixedText();
+               $newText = $new->getPrefixedText();
+               $oldLink = "<span class='plainlinks'>[$oldUrl $oldText]</span>";
+               $newLink = "<span class='plainlinks'>[$newUrl $newText]</span>";
 
-               $wgOut->addHtml( wfMsgExt( 'pagemovedtext', array( 'parse' ), $oldText, $newText ) );
+               $s = wfMsg( 'movepage-moved', $oldLink, $newLink, $oldText, $newText );
 
                if ( $talkmoved == 1 ) {
-                       $wgOut->addWikiText( wfMsg( 'talkpagemoved' ) );
+                       $s .= "\n\n" . wfMsg( 'talkpagemoved' );
                } elseif( 'articleexists' == $talkmoved ) {
-                       $wgOut->addWikiText( wfMsg( 'talkexists' ) );
+                       $s .= "\n\n" . wfMsg( 'talkexists' );
                } else {
-                       $oldTitle = Title::newFromText( $oldText );
-                       if ( isset( $oldTitle ) && !$oldTitle->isTalkPage() && $talkmoved != 'notalkpage' ) {
-                               $wgOut->addWikiText( wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) ) );
+                       if( !$old->isTalkPage() && $talkmoved != 'notalkpage' ) {
+                               $s .= "\n\n" . wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) );
                        }
                }
+               $wgOut->addWikiText( $s );
        }
        
        function showLogFragment( $title, &$out ) {
@@ -297,4 +308,4 @@ class MovePageForm {
        }
        
 }
-?>
+