<?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+
+/**
+ *
+ */
require_once( "LinksUpdate.php" );
-function wfSpecialMovepage()
-{
+/**
+ * Constructor
+ */
+function wfSpecialMovepage() {
global $wgUser, $wgOut, $wgRequest, $action, $wgOnlySysopMayMove;
# check rights. We don't want newbies to move pages to prevents possible attack
else { $f->showForm( '' ); }
}
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
class MovePageForm {
var $oldTitle, $newTitle; # Text input
$this->newTitle = $wgRequest->getText( 'wpNewTitle' );
}
- function showForm( $err )
- {
+ function showForm( $err ) {
global $wgOut, $wgUser, $wgLang;
$wgOut->setPagetitle( wfMsg( 'movepage' ) );
}
- function doSubmit()
- {
+ function doSubmit() {
global $wgOut, $wgUser, $wgLang;
global $wgDeferredUpdateList, $wgMessageCache;
global $wgUseSquid, $wgRequest;
$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 ) );
# 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,
$wgOut->redirect( $success );
}
- function showSuccess()
- {
+ function showSuccess() {
global $wgOut, $wgUser, $wgRequest;
$wgOut->setPagetitle( wfMsg( 'movepage' ) );