r41793 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41792‎ | r41793 | r41794 >
Date:02:25, 7 October 2008
Author:aaron
Status:old
Tags:
Comment:
Use $time param from r41788 to avoid extra queries
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -432,8 +432,8 @@
433433 $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()] = array();
434434 $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()][$time] = $sha1;
435435 # Bug 15748, be lax about commons image sync status
436 - $file = $file ? $file : wfFindFile( $title, $time ); # FIXME: would be nice not to double fetch!
437 - if( $file && $file->isLocal() && $time > $parser->mOutput->fr_newestImageTime ) {
 436+ $file = $file ? $file : wfLocalFile( $title, $time ); # FIXME: would be nice not to double fetch!
 437+ if( $file->exists() && $file->isLocal() && $time > $parser->mOutput->fr_newestImageTime ) {
438438 $parser->mOutput->fr_newestImageTime = $time;
439439 }
440440 return true;
@@ -503,8 +503,8 @@
504504 $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()] = array();
505505 $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()][$time] = $sha1;
506506 # Bug 15748, be lax about commons image sync status
507 - $file = $file ? $file : wfFindFile( $nt, $time ); # FIXME: would be nice not to double fetch!
508 - if( $file && $file->isLocal() && $time > $ig->mParser->mOutput->fr_newestImageTime ) {
 507+ $file = $file ? $file : wfLocalFile( $nt, $time ); # FIXME: would be nice not to double fetch!
 508+ if( $file->exists() && $file->isLocal() && $time > $ig->mParser->mOutput->fr_newestImageTime ) {
509509 $ig->mParser->mOutput->fr_newestImageTime = $time;
510510 }
511511 return true;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41788Add handy $time parameter to wfLocalFile()aaron00:30, 7 October 2008

Status & tagging log