r90489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90488‎ | r90489 | r90490 >
Date:22:18, 20 June 2011
Author:reedy
Status:ok
Tags:
Comment:
Revert r90488, rename variable from r90487
Modified paths:
  • /trunk/phase3/includes/api/ApiEditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiEditPage.php
@@ -58,7 +58,7 @@
5959 $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
6060 }
6161
62 - $result = $this->getResult();
 62+ $apiResult = $this->getResult();
6363
6464 if ( $params['redirect'] ) {
6565 if ( $titleObj->isRedirect() ) {
@@ -67,7 +67,7 @@
6868 $titles = Title::newFromRedirectArray( Revision::newFromTitle( $oldTitle )->getText( Revision::FOR_THIS_USER ) );
6969 // array_shift( $titles );
7070
71 - $result->addValue( null, 'foo', $titles );
 71+ $apiResult->addValue( null, 'foo', $titles );
7272
7373 $redirValues = array();
7474 foreach ( $titles as $id => $newTitle ) {
@@ -84,8 +84,8 @@
8585 $titleObj = $newTitle;
8686 }
8787
88 - $result->setIndexedTagName( $redirValues, 'r' );
89 - $result->addValue( null, 'redirects', $redirValues );
 88+ $apiResult->setIndexedTagName( $redirValues, 'r' );
 89+ $apiResult->addValue( null, 'redirects', $redirValues );
9090 }
9191 }
9292
@@ -257,7 +257,7 @@
258258 if ( !wfRunHooks( 'APIEditBeforeSave', array( $ep, $ep->textbox1, &$r ) ) ) {
259259 if ( count( $r ) ) {
260260 $r['result'] = 'Failure';
261 - $result->addValue( null, $this->getModuleName(), $r );
 261+ $apiResult->addValue( null, $this->getModuleName(), $r );
262262 return;
263263 } else {
264264 $this->dieUsageMsg( 'hookaborted' );
@@ -266,6 +266,7 @@
267267
268268 // Do the actual save
269269 $oldRevId = $articleObj->getRevIdFetched();
 270+ $result = null;
270271 // Fake $wgRequest for some hooks inside EditPage
271272 // @todo FIXME: This interface SUCKS
272273 $oldRequest = $wgRequest;
@@ -364,7 +365,7 @@
365366 default:
366367 $this->dieUsageMsg( array( 'unknownerror', $retval ) );
367368 }
368 - $result->addValue( null, $this->getModuleName(), $r );
 369+ $apiResult->addValue( null, $this->getModuleName(), $r );
369370 }
370371
371372 public function mustBePosted() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90487Define a local variable for $resultreedy22:13, 20 June 2011
r90488Followup r90487, kill $result=null in middlereedy22:16, 20 June 2011

Status & tagging log