http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70066

Revision: 70066
Author:   tstarling
Date:     2010-07-28 05:52:32 +0000 (Wed, 28 Jul 2010)

Log Message:
-----------
* 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/ApiBase.php
    branches/REL1_16/phase3/includes/api/ApiMain.php

Property Changed:
----------------
    branches/REL1_16/phase3/includes/api/
    branches/REL1_16/phase3/includes/api/ApiBase.php


Property changes on: branches/REL1_16/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/api:51646
/branches/sqlite/includes/api:58211-58321
/branches/wmf-deployment/includes/api:53381,59952
/trunk/phase3/includes/api:63549,63764,63897-63901,64454,64881,64948,69339,69347,69350,69369,69379,69776,69931
   + /branches/REL1_15/phase3/includes/api:51646
/branches/sqlite/includes/api:58211-58321
/branches/wmf/1.16wmf4/includes/api:70064
/branches/wmf-deployment/includes/api:53381,59952
/trunk/phase3/includes/api:63549,63764,63897-63901,64454,64881,64948,69339,69347,69350,69369,69379,69776,69931

Modified: branches/REL1_16/phase3/includes/api/ApiBase.php
===================================================================
--- branches/REL1_16/phase3/includes/api/ApiBase.php    2010-07-28 05:08:21 UTC 
(rev 70065)
+++ branches/REL1_16/phase3/includes/api/ApiBase.php    2010-07-28 05:52:32 UTC 
(rev 70066)
@@ -57,6 +57,7 @@
        const LIMIT_SML2 = 500; // Slow query, bot/sysop limit
 
        private $mMainModule, $mModuleName, $mModulePrefix;
+       private $mParamCache = array();
 
        /**
         * Constructor
@@ -472,16 +473,20 @@
         * @return array
         */
        public function extractRequestParams( $parseLimit = true ) {
-               $params = $this->getFinalParams();
-               $results = array();
+               // Cache parameters, for performance and to avoid bug 24564.
+               if ( !isset( $this->mParamCache[$parseLimit] ) ) {
+                       $params = $this->getFinalParams();
+                       $results = array();
 
-               if ( $params ) { // getFinalParams() can return false
-                       foreach ( $params as $paramName => $paramSettings ) {
-                               $results[$paramName] = 
$this->getParameterFromSettings( $paramName, $paramSettings, $parseLimit );
+                       if ( $params ) { // getFinalParams() can return false
+                               foreach ( $params as $paramName => 
$paramSettings ) {
+                                       $results[$paramName] = 
$this->getParameterFromSettings( 
+                                               $paramName, $paramSettings, 
$parseLimit );
+                               }
                        }
+                       $this->mParamCache[$parseLimit] = $results;
                }
-
-               return $results;
+               return $this->mParamCache[$parseLimit];
        }
 
        /**


Property changes on: branches/REL1_16/phase3/includes/api/ApiBase.php
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/REL1_15/phase3/includes/api/ApiBase.php:51646
/branches/sqlite/includes/api/ApiBase.php:58211-58321
/branches/wmf/1.16wmf4/includes/api/ApiBase.php:70064
/branches/wmf-deployment/includes/api/ApiBase.php:53381,59952
/trunk/phase3/includes/api/ApiBase.php:63549,63764,63897-63901,64454,64881,64948,69339,69347,69350,69369,69379,69776,69931,70062

Modified: branches/REL1_16/phase3/includes/api/ApiMain.php
===================================================================
--- branches/REL1_16/phase3/includes/api/ApiMain.php    2010-07-28 05:08:21 UTC 
(rev 70065)
+++ branches/REL1_16/phase3/includes/api/ApiMain.php    2010-07-28 05:52:32 UTC 
(rev 70066)
@@ -371,7 +371,7 @@
                // avoid sending public cache headers for errors.
                $this->sendCacheHeaders();
 
-               if ( $this->mPrinter->getIsHtml() && 
!$this->mPrinter->isDisabled() ) {
+               if ( $this->mPrinter->getIsHtml() ) {
                        echo wfReportTime();
                }
 



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to