$wgOut->setPagetitle( wfMsg( 'movepage' ) );
- if ( $this->oldTitle == '' ) {
+ $ot = Title::newFromURL( $this->oldTitle );
+ if( is_null( $ot ) ) {
$wgOut->errorpage( 'notargettitle', 'notargettext' );
return;
}
-
- $ot = Title::newFromURL( $this->oldTitle );
$oldTitle = $ot->getPrefixedText();
- $encOldTitle = htmlspecialchars( $this->oldTitle );
+ $encOldTitle = htmlspecialchars( $oldTitle );
if( $this->newTitle == '' ) {
# Show the current title as a default
# when the form is first opened.
- $encNewTitle = $oldTitle;
+ $encNewTitle = $encOldTitle;
} else {
if( $err == '' ) {
$nt = Title::newFromURL( $this->newTitle );
if ( $err == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) {
$wgOut->addWikiText( wfMsg( 'delete_and_move_text', $encNewTitle ) );
- $movepagebtn = wfMsg( 'delete_and_move' );
+ $movepagebtn = wfMsgHtml( 'delete_and_move' );
$submitVar = 'wpDeleteAndMove';
$err = '';
} else {
$wgOut->addWikiText( wfMsg( 'movepagetext' ) );
- $movepagebtn = wfMsg( 'movepagebtn' );
+ $movepagebtn = wfMsgHtml( 'movepagebtn' );
$submitVar = 'wpMove';
}
$wgOut->addWikiText( wfMsg( 'movepagetalktext' ) );
}
- $movearticle = wfMsg( 'movearticle' );
- $newtitle = wfMsg( 'newtitle' );
- $movetalk = wfMsg( 'movetalk' );
- $movereason = wfMsg( 'movereason' );
+ $movearticle = wfMsgHtml( 'movearticle' );
+ $newtitle = wfMsgHtml( 'newtitle' );
+ $movetalk = wfMsgHtml( 'movetalk' );
+ $movereason = wfMsgHtml( 'movereason' );
$titleObj = Title::makeTitle( NS_SPECIAL, 'Movepage' );
$action = $titleObj->escapeLocalURL( 'action=submit' );
if ( $err != '' ) {
$wgOut->setSubtitle( wfMsg( 'formerror' ) );
- $wgOut->addHTML( '<p class="error">' . wfMsg($err) . "</p>\n" );
+ $wgOut->addWikiText( '<p class="error">' . wfMsg($err) . "</p>\n" );
}
$moveTalkChecked = $this->moveTalk ? ' checked="checked"' : '';
global $wgUseSquid, $wgRequest;
$fname = "MovePageForm::doSubmit";
+ if ( $wgUser->pingLimiter( 'move' ) ) {
+ $wgOut->rateLimited();
+ return;
+ }
+
# Variables beginning with 'o' for old article 'n' for new article
$ot = Title::newFromText( $this->oldTitle );
$this->showForm( $error );
return;
}
-
- # Update counters if the article got moved into or out of NS_MAIN namespace
- $ons = $ot->getNamespace();
- $nns = $nt->getNamespace();
-
- # moved out of article namespace?
- if ( $ons == NS_MAIN and $nns != NS_MAIN ) {
- $u = new SiteStatsUpdate( 0, 1, -1); # not viewed, edited, removing
- }
- # moved into article namespace?
- elseif ( $ons != NS_MAIN and $nns == NS_MAIN ) {
- $u = new SiteStatsUpdate( 0, 1, +1 ); # not viewed, edited, adding
- } else {
- $u = false;
- }
- if ( $u !== false ) {
- # save it for later update
- array_push( $wgDeferredUpdateList, $u );
- unset($u);
- }
# Move talk page if
# (1) the checkbox says to,
$wgRawHtml = $marchingantofdoom;
if ( $talkmoved == 1 ) {
- $wgOut->addHTML( "\n<p>" . wfMsg( 'talkpagemoved' ) . "</p>\n" );
+ $wgOut->addWikiText( wfMsg( 'talkpagemoved' ) );
} elseif( 'articleexists' == $talkmoved ) {
- $wgOut->addHTML( "\n<p><strong>" . wfMsg( 'talkexists' ) . "</strong></p>\n" );
+ $wgOut->addWikiText( wfMsg( 'talkexists' ) );
} else {
$ot = Title::newFromURL( $oldtitle );
if ( ! $ot->isTalkPage() ) {
- $wgOut->addHTML( "\n<p>" . wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) ) . "</p>\n" );
+ $wgOut->addWikiText( wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) ) );
}
}
}