Index: trunk/phase3/includes/api/ApiEditPage.php |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) ); |
60 | 60 | } |
61 | 61 | |
62 | | - $result = $this->getResult(); |
| 62 | + $apiResult = $this->getResult(); |
63 | 63 | |
64 | 64 | if ( $params['redirect'] ) { |
65 | 65 | if ( $titleObj->isRedirect() ) { |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | $titles = Title::newFromRedirectArray( Revision::newFromTitle( $oldTitle )->getText( Revision::FOR_THIS_USER ) ); |
69 | 69 | // array_shift( $titles ); |
70 | 70 | |
71 | | - $result->addValue( null, 'foo', $titles ); |
| 71 | + $apiResult->addValue( null, 'foo', $titles ); |
72 | 72 | |
73 | 73 | $redirValues = array(); |
74 | 74 | foreach ( $titles as $id => $newTitle ) { |
— | — | @@ -84,8 +84,8 @@ |
85 | 85 | $titleObj = $newTitle; |
86 | 86 | } |
87 | 87 | |
88 | | - $result->setIndexedTagName( $redirValues, 'r' ); |
89 | | - $result->addValue( null, 'redirects', $redirValues ); |
| 88 | + $apiResult->setIndexedTagName( $redirValues, 'r' ); |
| 89 | + $apiResult->addValue( null, 'redirects', $redirValues ); |
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
— | — | @@ -257,7 +257,7 @@ |
258 | 258 | if ( !wfRunHooks( 'APIEditBeforeSave', array( $ep, $ep->textbox1, &$r ) ) ) { |
259 | 259 | if ( count( $r ) ) { |
260 | 260 | $r['result'] = 'Failure'; |
261 | | - $result->addValue( null, $this->getModuleName(), $r ); |
| 261 | + $apiResult->addValue( null, $this->getModuleName(), $r ); |
262 | 262 | return; |
263 | 263 | } else { |
264 | 264 | $this->dieUsageMsg( 'hookaborted' ); |
— | — | @@ -266,6 +266,7 @@ |
267 | 267 | |
268 | 268 | // Do the actual save |
269 | 269 | $oldRevId = $articleObj->getRevIdFetched(); |
| 270 | + $result = null; |
270 | 271 | // Fake $wgRequest for some hooks inside EditPage |
271 | 272 | // @todo FIXME: This interface SUCKS |
272 | 273 | $oldRequest = $wgRequest; |
— | — | @@ -364,7 +365,7 @@ |
365 | 366 | default: |
366 | 367 | $this->dieUsageMsg( array( 'unknownerror', $retval ) ); |
367 | 368 | } |
368 | | - $result->addValue( null, $this->getModuleName(), $r ); |
| 369 | + $apiResult->addValue( null, $this->getModuleName(), $r ); |
369 | 370 | } |
370 | 371 | |
371 | 372 | public function mustBePosted() { |