X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FSpecialMovepage.php;h=70c8a4feda1301d3a674e70de30f91e82ef52f2e;hb=d194296a6a0ffd28fdd2387139c6070a3763bb19;hp=447eaf82e1b6e54fcb8f6e39fb6aea6e04391827;hpb=753cfc15532a39b835a77ce4bd9bdc86581180e0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 447eaf82e1..70c8a4feda 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -63,19 +63,18 @@ class MovePageForm { $wgOut->setPagetitle( wfMsg( 'movepage' ) ); - if ( $this->oldTitle == '' ) { + $ot = Title::newFromURL( $this->oldTitle ); + if( is_null( $ot ) ) { $wgOut->errorpage( 'notargettitle', 'notargettext' ); return; } - - $ot = Title::newFromURL( $this->oldTitle ); $oldTitle = $ot->getPrefixedText(); - $encOldTitle = htmlspecialchars( $this->oldTitle ); + $encOldTitle = htmlspecialchars( $oldTitle ); if( $this->newTitle == '' ) { # Show the current title as a default # when the form is first opened. - $encNewTitle = $oldTitle; + $encNewTitle = $encOldTitle; } else { if( $err == '' ) { $nt = Title::newFromURL( $this->newTitle ); @@ -207,17 +206,11 @@ class MovePageForm { # (2) the namespaces are not themselves talk namespaces, and of course # (3) it exists. if ( ( $wgRequest->getVal('wpMovetalk') == 1 ) && - ( ! Namespace::isTalk( $ons ) ) && - ( ! Namespace::isTalk( $nns ) ) ) { - - # get old talk page namespace - $ons = Namespace::getTalk( $ons ); - # get new talk page namespace - $nns = Namespace::getTalk( $nns ); + !$ot->isTalkPage() && + !$nt->isTalkPage() ) { - # make talk page title objects - $ott = Title::makeTitle( $ons, $ot->getDBkey() ); - $ntt = Title::makeTitle( $nns, $nt->getDBkey() ); + $ott = $ot->getTalkPage(); + $ntt = $nt->getTalkPage(); # Attempt the move $error = $ott->moveTo( $ntt, true, $this->reason );