(bug 737) only use the post-parse link placeholders within replaceInternalLinks().
[lhc/web/wiklou.git] / includes / SpecialMovepage.php
index 4fc6435..dbba17d 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
  *
+ * @package MediaWiki
+ * @subpackage SpecialPage
  */
 
 /**
@@ -34,6 +36,8 @@ function wfSpecialMovepage() {
 
 /**
  *
+ * @package MediaWiki
+ * @subpackage SpecialPage
  */
 class MovePageForm {
        var $oldTitle, $newTitle; # Text input
@@ -125,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 ) );
@@ -199,7 +209,10 @@ class MovePageForm {
                $talkmoved = $wgRequest->getVal('talkmoved');
 
                $text = wfMsg( 'pagemovedtext', $oldtitle, $newtitle );
+               $marchingantofdoom = $wgRawHtml;
+               $wgRawHtml = false;
                $wgOut->addWikiText( $text );
+               $wgRawHtml = $marchingantofdoom;
 
                if ( $talkmoved == 1 ) {
                        $wgOut->addHTML( "\n<p>" . wfMsg( 'talkpagemoved' ) . "</p>\n" );