X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialMovepage.php;h=ebbd79db2a26e77a4c43a1928e7002aa2c143bea;hb=2a03980093b5168a834bbf65e820c5400e29b21b;hp=ee7342a1f7344874317df506e99f46e2e4746355;hpb=5424706764096a6e91d46279b387261a6c285613;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index ee7342a1f7..ebbd79db2a 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -1,8 +1,19 @@ showForm( '' ); } } +/** + * + * @package MediaWiki + * @subpackage SpecialPage + */ class MovePageForm { var $oldTitle, $newTitle; # Text input @@ -32,8 +48,7 @@ class MovePageForm { $this->newTitle = $wgRequest->getText( 'wpNewTitle' ); } - function showForm( $err ) - { + function showForm( $err ) { global $wgOut, $wgUser, $wgLang; $wgOut->setPagetitle( wfMsg( 'movepage' ) ); @@ -101,8 +116,7 @@ class MovePageForm { } - function doSubmit() - { + function doSubmit() { global $wgOut, $wgUser, $wgLang; global $wgDeferredUpdateList, $wgMessageCache; global $wgUseSquid, $wgRequest; @@ -115,6 +129,12 @@ class MovePageForm { $ot = Title::newFromText( $this->oldTitle ); $nt = Title::newFromText( $this->newTitle ); + # don't allow moving to pages with # in + if ( !$nt || $nt->getFragment() != '' ) { + $this->showForm( wfMsg( "badtitletext" ) ); + return; + } + $error = $ot->moveTo( $nt ); if ( $error !== true ) { $this->showForm( wfMsg( $error ) ); @@ -132,11 +152,14 @@ class MovePageForm { # 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); } - - # save it for later update - array_push( $wgDeferredUpdateList, $u ); - unset($u); # Move talk page if # (1) the checkbox says to, @@ -176,8 +199,7 @@ class MovePageForm { $wgOut->redirect( $success ); } - function showSuccess() - { + function showSuccess() { global $wgOut, $wgUser, $wgRequest; $wgOut->setPagetitle( wfMsg( 'movepage' ) );