r78803 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78802‎ | r78803 | r78804 >
Date:16:18, 22 December 2010
Author:catrope
Status:ok
Tags:
Comment:
Fix reported database error in updateSpecialPages.php for SpecialMIMEsearch, by returning 0 rather than false from QueryPage::recache() for uncacheable pages
Modified paths:
  • /trunk/phase3/includes/QueryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/QueryPage.php
@@ -270,10 +270,14 @@
271271 * @param $ignoreErrors Boolean: whether to ignore database errors
272272 */
273273 function recache( $limit, $ignoreErrors = true ) {
 274+ if ( !$this->isCacheable() ) {
 275+ return 0;
 276+ }
 277+
274278 $fname = get_class( $this ) . '::recache';
275279 $dbw = wfGetDB( DB_MASTER );
276280 $dbr = wfGetDB( DB_SLAVE, array( $this->getName(), __METHOD__, 'vslow' ) );
277 - if ( !$dbw || !$dbr || !$this->isCacheable() ) {
 281+ if ( !$dbw || !$dbr ) {
278282 return false;
279283 }
280284

Status & tagging log