Scripts and data used for generating ZhConversion.php
[lhc/web/wiklou.git] / includes / SpecialMovepage.php
index 024390b..4f0c48d 100644 (file)
@@ -122,12 +122,6 @@ class MovePageForm {
                global  $wgUseSquid, $wgRequest;
                $fname = "MovePageForm::doSubmit";
                
-                # don't allow moving to pages with # in
-                if ( strchr( $this->newTitle, '#') !== FALSE ) {
-                        $this->showForm( wfMsg( "badtitletext" ) );
-                        return;
-                }
-
                # Variables beginning with 'o' for old article 'n' for new article
 
                # Attempt to move the article
@@ -135,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->getFragment() != '' ) {
+                       $this->showForm( wfMsg( "badtitletext" ) );
+                       return;
+               }
+
                $error = $ot->moveTo( $nt );
                if ( $error !== true ) {
                        $this->showForm( wfMsg( $error ) );