r106755 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106754‎ | r106755 | r106756 >
Date:04:22, 20 December 2011
Author:kaldari
Status:ok
Tags:
Comment:
$reqArr is an ambiguous variable name - req can mean required or request. Changing to an unambiguous name
Modified paths:
  • /trunk/phase3/includes/api/ApiEditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiEditPage.php
@@ -172,40 +172,40 @@
173173
174174 // EditPage wants to parse its stuff from a WebRequest
175175 // That interface kind of sucks, but it's workable
176 - $reqArr = array(
 176+ $requestArray = array(
177177 'wpTextbox1' => $params['text'],
178178 'wpEditToken' => $params['token'],
179179 'wpIgnoreBlankSummary' => ''
180180 );
181181
182182 if ( !is_null( $params['summary'] ) ) {
183 - $reqArr['wpSummary'] = $params['summary'];
 183+ $requestArray['wpSummary'] = $params['summary'];
184184 }
185185
186186 if ( !is_null( $params['sectiontitle'] ) ) {
187 - $reqArr['wpSectionTitle'] = $params['sectiontitle'];
 187+ $requestArray['wpSectionTitle'] = $params['sectiontitle'];
188188 }
189189
190190 // Watch out for basetimestamp == ''
191191 // wfTimestamp() treats it as NOW, almost certainly causing an edit conflict
192192 if ( !is_null( $params['basetimestamp'] ) && $params['basetimestamp'] != '' ) {
193 - $reqArr['wpEdittime'] = wfTimestamp( TS_MW, $params['basetimestamp'] );
 193+ $requestArray['wpEdittime'] = wfTimestamp( TS_MW, $params['basetimestamp'] );
194194 } else {
195 - $reqArr['wpEdittime'] = $articleObj->getTimestamp();
 195+ $requestArray['wpEdittime'] = $articleObj->getTimestamp();
196196 }
197197
198198 if ( !is_null( $params['starttimestamp'] ) && $params['starttimestamp'] != '' ) {
199 - $reqArr['wpStarttime'] = wfTimestamp( TS_MW, $params['starttimestamp'] );
 199+ $requestArray['wpStarttime'] = wfTimestamp( TS_MW, $params['starttimestamp'] );
200200 } else {
201 - $reqArr['wpStarttime'] = wfTimestampNow(); // Fake wpStartime
 201+ $requestArray['wpStarttime'] = wfTimestampNow(); // Fake wpStartime
202202 }
203203
204204 if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) ) {
205 - $reqArr['wpMinoredit'] = '';
 205+ $requestArray['wpMinoredit'] = '';
206206 }
207207
208208 if ( $params['recreate'] ) {
209 - $reqArr['wpRecreate'] = '';
 209+ $requestArray['wpRecreate'] = '';
210210 }
211211
212212 if ( !is_null( $params['section'] ) ) {
@@ -213,9 +213,9 @@
214214 if ( $section == 0 && $params['section'] != '0' && $params['section'] != 'new' ) {
215215 $this->dieUsage( "The section parameter must be set to an integer or 'new'", "invalidsection" );
216216 }
217 - $reqArr['wpSection'] = $params['section'];
 217+ $requestArray['wpSection'] = $params['section'];
218218 } else {
219 - $reqArr['wpSection'] = '';
 219+ $requestArray['wpSection'] = '';
220220 }
221221
222222 $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj );
@@ -228,12 +228,12 @@
229229 }
230230
231231 if ( $watch ) {
232 - $reqArr['wpWatchthis'] = '';
 232+ $requestArray['wpWatchthis'] = '';
233233 }
234234
235235 global $wgTitle, $wgRequest;
236236
237 - $req = new DerivativeRequest( $this->getRequest(), $reqArr, true );
 237+ $req = new DerivativeRequest( $this->getRequest(), $requestArray, true );
238238
239239 // Some functions depend on $wgTitle == $ep->mTitle
240240 // TODO: Make them not or check if they still do

Status & tagging log