X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiMove.php;h=9d73562bbee18ef76c3238f4d0755a3850dc789e;hb=6e930328fa65926c97c7ed14dc53e465f2b8c541;hp=55148b1886521ffeb6076fa8e7102f61bd9d22cb;hpb=be8dc381e13d96f18bb7bc2c2e404a39595a22e7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index 55148b1886..9d73562bbe 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -75,6 +75,7 @@ class ApiMove extends ApiBase { } // Move the page + $toTitleExists = $toTitle->exists(); $retval = $fromTitle->moveTo( $toTitle, true, $params['reason'], !$params['noredirect'] ); if ( $retval !== true ) { $this->dieUsageMsg( reset( $retval ) ); @@ -84,13 +85,20 @@ class ApiMove extends ApiBase { if ( !$params['noredirect'] || !$user->isAllowed( 'suppressredirect' ) ) { $r['redirectcreated'] = ''; } + if( $toTitleExists ) { + $r['moveoverredirect'] = ''; + } // Move the talk page if ( $params['movetalk'] && $fromTalk->exists() && !$fromTitle->isTalkPage() ) { + $toTalkExists = $toTalk->exists(); $retval = $fromTalk->moveTo( $toTalk, true, $params['reason'], !$params['noredirect'] ); if ( $retval === true ) { $r['talkfrom'] = $fromTalk->getPrefixedText(); $r['talkto'] = $toTalk->getPrefixedText(); + if( $toTalkExists ) { + $r['talkmoveoverredirect'] = ''; + } } else { // We're not gonna dieUsage() on failure, since we already changed something $parsed = $this->parseMsg( reset( $retval ) ); @@ -231,6 +239,7 @@ class ApiMove extends ApiBase { 'to' => 'string', 'reason' => 'string', 'redirectcreated' => 'boolean', + 'moveoverredirect' => 'boolean', 'talkfrom' => array( ApiBase::PROP_TYPE => 'string', ApiBase::PROP_NULLABLE => true @@ -239,6 +248,7 @@ class ApiMove extends ApiBase { ApiBase::PROP_TYPE => 'string', ApiBase::PROP_NULLABLE => true ), + 'talkmoveoverredirect' => 'boolean', 'talkmove-error-code' => array( ApiBase::PROP_TYPE => 'string', ApiBase::PROP_NULLABLE => true