function wfSpecialMovepage()
{
- global $wgUser, $wgOut, $action, $target;
+ global $wgUser, $wgOut;
if ( 0 == $wgUser->getID() or $wgUser->isBlocked() ) {
$wgOut->errorpage( "movenologin", "movenologintext" );
$f = new MovePageForm();
- if ( "success" == $action ) { $f->showSuccess(); }
- else if ( "submit" == $action ) { $f->doSubmit(); }
+ if ( "success" == $_REQUEST['action'] ) { $f->showSuccess(); }
+ else if ( "submit" == $_REQUEST['action'] ) { $f->doSubmit(); }
else { $f->showForm( "" ); }
}
function showForm( $err )
{
global $wgOut, $wgUser, $wgLang;
- global $wpNewTitle, $wpOldTitle, $wpMovetalk, $target;
$wgOut->setPagetitle( wfMsg( "movepage" ) );
- if ( ! $wpOldTitle ) {
- $target = wfCleanQueryVar( $target );
- if ( "" == $target ) {
+ if ( ! $_REQUEST['wpOldTitle'] ) {
+ if ( "" == $_REQUEST['target'] ) {
$wgOut->errorpage( "notargettitle", "notargettext" );
return;
}
- $wpOldTitle = $target;
+ $oldTitle = htmlspecialchars( $_REQUEST['target'] );
+ } else {
+ $oldTitle = htmlspecialchars( $_REQUEST['wpOldTitle'] );
}
- $ot = Title::newFromURL( $wpOldTitle );
+
+ $encOldTitle = htmlspecialchars( $oldTitle );
+ $encNewTitle = htmlspecialchars( $_REQUEST['wpNewTitle'] );
+ $ot = Title::newFromURL( $oldTitle );
$ott = $ot->getPrefixedText();
$wgOut->addWikiText( wfMsg( "movepagetext" ) );
$mpb = wfMsg( "movepagebtn" );
$movetalk = wfMsg( "movetalk" );
- $action = wfLocalUrlE( $wgLang->specialPage( "Movepage" ),
- "action=submit" );
+ $titleObj = Title::makeTitle( NS_SPECIAL, "Movepage" );
+ $action = $titleObj->getURL( "action=submit", true );
if ( "" != $err ) {
$wgOut->setSubtitle( wfMsg( "formerror" ) );
</tr><tr>
<td align=right>{$newt}:</td>
<td align=left>
-<input type=text size=40 name=\"wpNewTitle\" value=\"{$wpNewTitle}\">
-<input type=hidden name=\"wpOldTitle\" value=\"{$wpOldTitle}\">
+<input type=text size=40 name=\"wpNewTitle\" value=\"{$encNewTitle}\">
+<input type=hidden name=\"wpOldTitle\" value=\"{$encOldTitle}\">
</td>
</tr>" );
function doSubmit()
{
global $wgOut, $wgUser, $wgLang;
- global $wpNewTitle, $wpOldTitle, $wpMovetalk, $target;
global $wgDeferredUpdateList, $wgMessageCache;
global $wgUseSquid, $wgInternalServer;
$fname = "MovePageForm::doSubmit";
- $this->ot = Title::newFromText( $wpOldTitle );
- $this->nt = Title::newFromText( $wpNewTitle );
+ $this->ot = Title::newFromText( $_REQUEST['wpOldTitle'] );
+ $this->nt = Title::newFromText( $_REQUEST['wpNewTitle'] );
if( !$this->ot or !$this->nt ) {
$this->showForm( wfMsg( "badtitletext" ) );
return;
/* this needs to be done after LinksUpdate */
$urlArr = Array(
# purge new title
- $wgInternalServer.wfLocalUrl( $this->nt->getPrefixedURL()),
+ $wgInternalServer.$this->nt->getURL(),
# purge old title
- $wgInternalServer.wfLocalUrl( $this->ot->getPrefixedURL())
+ $wgInternalServer.$this->ot->getURL())
);
wfPurgeSquidServers($urlArr);
# purge pages linking to new title
# and target namespaces are identical, (3) the namespaces are not
# themselves talk namespaces, and of course (4) it exists.
- if ( ( 1 == $wpMovetalk ) &&
+ if ( ( 1 == $_REQUEST['wpMovetalk'] ) &&
( ! Namespace::isTalk( $this->ons ) ) &&
( $this->ons == $this->nns ) ) {
/* this needs to be done after LinksUpdate */
$urlArr = Array(
# purge new title
- $wgInternalServer.wfLocalUrl( $this->nt->getPrefixedURL()),
+ $wgInternalServer.$nt->getURL()),
# purge old title
- $wgInternalServer.wfLocalUrl( $this->ot->getPrefixedURL())
+ $wgInternalServer.$ot->getURL())
);
wfPurgeSquidServers($urlArr);
# purge pages linking to new title
}
}
}
- $success = wfLocalUrl( $wgLang->specialPage( "Movepage" ),
+ $titleObj = Title::makeTitle( NS_SPECIAL, "Movepage" );
+ $success = $titleObj->getURL(
"action=success&oldtitle=" . wfUrlencode( $this->ofx ) .
"&newtitle=" . wfUrlencode( $this->nfx ) .
"&talkmoved={$this->talkmoved}" );
function showSuccess()
{
global $wgOut, $wgUser;
- global $newtitle, $oldtitle, $talkmoved;
$wgOut->setPagetitle( wfMsg( "movepage" ) );
$wgOut->setSubtitle( wfMsg( "pagemovedsub" ) );
-
- $fields = array( "oldtitle", "newtitle" );
- wfCleanFormFields( $fields );
-
- $text = wfMsg( "pagemovedtext", $oldtitle, $newtitle );
+
+ $text = wfMsg( "pagemovedtext", $_REQUEST['oldtitle'], $_REQUEST['newtitle'] );
$wgOut->addWikiText( $text );
- if ( 1 == $talkmoved ) {
+ if ( 1 == $_REQUEST['talkmoved'] ) {
$wgOut->addHTML( "\n<p>" . wfMsg( "talkpagemoved" ) );
- } elseif( 'invalid' == $talkmoved ) {
+ } elseif( 'invalid' == $_REQUEST['talkmoved'] ) {
$wgOut->addHTML( "\n<p><strong>" . wfMsg( "talkexists" ) . "</strong>" );
} else {
- $ot = Title::newFromURL( $oldtitle );
+ $ot = Title::newFromURL( $_REQUEST['oldtitle'] );
if ( ! Namespace::isTalk( $ot->getNamespace() ) ) {
$wgOut->addHTML( "\n<p>" . wfMsg( "talkpagenotmoved" ) );
}