From: Brion Vibber Date: Tue, 26 Oct 2004 03:51:59 +0000 (+0000) Subject: Move page tweaks: X-Git-Tag: 1.5.0alpha1~1446 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=f92d1f7588558ec1376084c807c0983677c32b5c;p=lhc%2Fweb%2Fwiklou.git Move page tweaks: * Allow [[0]] to be renamed * Fix the $wgRawHtml check so it actually works * (bug 776) Old title as default for new title when moving pages [modified patch from guanaco] --- diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index dbba17db2a..b7e6e2b9c2 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -53,13 +53,19 @@ class MovePageForm { $wgOut->setPagetitle( wfMsg( 'movepage' ) ); - if ( empty( $this->oldTitle ) ) { + if ( $this->oldTitle == "" ) { $wgOut->errorpage( 'notargettitle', 'notargettext' ); return; } $encOldTitle = htmlspecialchars( $this->oldTitle ); - $encNewTitle = htmlspecialchars( $this->newTitle ); + if( $this->newTitle == "" ) { + # Show the current title as a default + # when the form is first opened. + $encNewTitle = $encOldTitle; + } else { + $encNewTitle = htmlspecialchars( $this->newTitle ); + } $ot = Title::newFromURL( $this->oldTitle ); $ott = $ot->getPrefixedText(); @@ -200,7 +206,7 @@ class MovePageForm { } function showSuccess() { - global $wgOut, $wgUser, $wgRequest; + global $wgOut, $wgUser, $wgRequest, $wgRawHtml; $wgOut->setPagetitle( wfMsg( 'movepage' ) ); $wgOut->setSubtitle( wfMsg( 'pagemovedsub' ) ); @@ -209,6 +215,8 @@ class MovePageForm { $talkmoved = $wgRequest->getVal('talkmoved'); $text = wfMsg( 'pagemovedtext', $oldtitle, $newtitle ); + + # Temporarily disable raw html wikitext option out of XSS paranoia $marchingantofdoom = $wgRawHtml; $wgRawHtml = false; $wgOut->addWikiText( $text );