Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -57,6 +57,7 @@ |
58 | 58 | const LIMIT_SML2 = 500; // Slow query, bot/sysop limit |
59 | 59 | |
60 | 60 | private $mMainModule, $mModuleName, $mModulePrefix; |
| 61 | + private $mParamCache = array(); |
61 | 62 | |
62 | 63 | /** |
63 | 64 | * Constructor |
— | — | @@ -479,16 +480,20 @@ |
480 | 481 | * @return array |
481 | 482 | */ |
482 | 483 | public function extractRequestParams( $parseLimit = true ) { |
483 | | - $params = $this->getFinalParams(); |
484 | | - $results = array(); |
| 484 | + // Cache parameters, for performance and to avoid bug 24564. |
| 485 | + if ( !isset( $this->mParamCache[$parseLimit] ) ) { |
| 486 | + $params = $this->getFinalParams(); |
| 487 | + $results = array(); |
485 | 488 | |
486 | | - if ( $params ) { // getFinalParams() can return false |
487 | | - foreach ( $params as $paramName => $paramSettings ) { |
488 | | - $results[$paramName] = $this->getParameterFromSettings( $paramName, $paramSettings, $parseLimit ); |
| 489 | + if ( $params ) { // getFinalParams() can return false |
| 490 | + foreach ( $params as $paramName => $paramSettings ) { |
| 491 | + $results[$paramName] = $this->getParameterFromSettings( |
| 492 | + $paramName, $paramSettings, $parseLimit ); |
| 493 | + } |
489 | 494 | } |
| 495 | + $this->mParamCache[$parseLimit] = $results; |
490 | 496 | } |
491 | | - |
492 | | - return $results; |
| 497 | + return $this->mParamCache[$parseLimit]; |
493 | 498 | } |
494 | 499 | |
495 | 500 | /** |