r70066 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70065‎ | r70066 | r70067 >
Date:05:52, 28 July 2010
Author:tstarling
Status:ok
Tags:
Comment:
* MFT r70062: fix for bug 24564 (fatal error with limit=max)
* Merge r70064 from 1.16wmf4: fix for error in merge r69932, call to undefined function isDisabled(). Fixes a fatal error when an HTML result format is requested.

Both are fixes to unreleased bugs, so a release notes update is unnecessary.
Modified paths:
  • /branches/REL1_16/phase3/includes/api (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiBase.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: branches/REL1_16/phase3/includes/api/ApiMain.php
@@ -371,7 +371,7 @@
372372 // avoid sending public cache headers for errors.
373373 $this->sendCacheHeaders();
374374
375 - if ( $this->mPrinter->getIsHtml() && !$this->mPrinter->isDisabled() ) {
 375+ if ( $this->mPrinter->getIsHtml() ) {
376376 echo wfReportTime();
377377 }
378378
Index: branches/REL1_16/phase3/includes/api/ApiBase.php
@@ -57,6 +57,7 @@
5858 const LIMIT_SML2 = 500; // Slow query, bot/sysop limit
5959
6060 private $mMainModule, $mModuleName, $mModulePrefix;
 61+ private $mParamCache = array();
6162
6263 /**
6364 * Constructor
@@ -472,16 +473,20 @@
473474 * @return array
474475 */
475476 public function extractRequestParams( $parseLimit = true ) {
476 - $params = $this->getFinalParams();
477 - $results = array();
 477+ // Cache parameters, for performance and to avoid bug 24564.
 478+ if ( !isset( $this->mParamCache[$parseLimit] ) ) {
 479+ $params = $this->getFinalParams();
 480+ $results = array();
478481
479 - if ( $params ) { // getFinalParams() can return false
480 - foreach ( $params as $paramName => $paramSettings ) {
481 - $results[$paramName] = $this->getParameterFromSettings( $paramName, $paramSettings, $parseLimit );
 482+ if ( $params ) { // getFinalParams() can return false
 483+ foreach ( $params as $paramName => $paramSettings ) {
 484+ $results[$paramName] = $this->getParameterFromSettings(
 485+ $paramName, $paramSettings, $parseLimit );
 486+ }
482487 }
 488+ $this->mParamCache[$parseLimit] = $results;
483489 }
484 -
485 - return $results;
 490+ return $this->mParamCache[$parseLimit];
486491 }
487492
488493 /**
Property changes on: branches/REL1_16/phase3/includes/api/ApiBase.php
___________________________________________________________________
Added: svn:mergeinfo
489494 Merged /branches/wmf-deployment/includes/api/ApiBase.php:r53381,59952
490495 Merged /branches/REL1_15/phase3/includes/api/ApiBase.php:r51646
491496 Merged /branches/wmf/1.16wmf4/includes/api/ApiBase.php:r70064
492497 Merged /branches/sqlite/includes/api/ApiBase.php:r58211-58321
493498 Merged /trunk/phase3/includes/api/ApiBase.php:r63549,63764,63897-63901,64454,64881,64948,69339,69347,69350,69369,69379,69776,69931,70062
Property changes on: branches/REL1_16/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
494499 Merged /branches/wmf/1.16wmf4/includes/api:r70064

Follow-up revisions

RevisionCommit summaryAuthorDate
r70078(bug 24564) Fix fatal errors when using list=deletedrevs, prop=revisions or o...btongminh11:30, 28 July 2010
r70818MFT r70078 to REL1_15...reedy14:21, 10 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r69932* MFT r69776, and followups r69784, r69928, r69931, and superseded base revis...tstarling08:03, 26 July 2010
r70062Reintroduced the extractRequestParams() memoization as in r69782, but respect...tstarling04:12, 28 July 2010
r70064Fixed fatal error when HTML result formats are used, due to botched merge.tstarling04:22, 28 July 2010

Status & tagging log