Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2790,8 +2790,8 @@ |
2791 | 2791 | * Get an object referring to a locally registered file. |
2792 | 2792 | * Returns a valid placeholder object if the file does not exist. |
2793 | 2793 | */ |
2794 | | -function wfLocalFile( $title, $time = false ) { |
2795 | | - return RepoGroup::singleton()->getLocalRepo()->newFile( $title, $time ); |
| 2794 | +function wfLocalFile( $title ) { |
| 2795 | + return RepoGroup::singleton()->getLocalRepo()->newFile( $title ); |
2796 | 2796 | } |
2797 | 2797 | |
2798 | 2798 | /** |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -432,7 +432,7 @@ |
433 | 433 | $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()] = array(); |
434 | 434 | $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()][$time] = $sha1; |
435 | 435 | # Bug 15748, be lax about commons image sync status |
436 | | - $file = $file ? $file : wfLocalFile( $title, $time ); # FIXME: would be nice not to double fetch! |
| 436 | + $file = $file ? $file : self::getLocalFile( $title, $time ); # FIXME: would be nice not to double fetch! |
437 | 437 | if( $file->exists() && $file->isLocal() && $time > $parser->mOutput->fr_newestImageTime ) { |
438 | 438 | $parser->mOutput->fr_newestImageTime = $time; |
439 | 439 | } |
— | — | @@ -503,12 +503,13 @@ |
504 | 504 | $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()] = array(); |
505 | 505 | $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()][$time] = $sha1; |
506 | 506 | # Bug 15748, be lax about commons image sync status |
507 | | - $file = $file ? $file : wfLocalFile( $nt, $time ); # FIXME: would be nice not to double fetch! |
| 507 | + $file = $file ? $file : self::getLocalFile( $nt, $time ); # FIXME: would be nice not to double fetch! |
508 | 508 | if( $file->exists() && $file->isLocal() && $time > $ig->mParser->mOutput->fr_newestImageTime ) { |
509 | 509 | $ig->mParser->mOutput->fr_newestImageTime = $time; |
510 | 510 | } |
511 | 511 | return true; |
512 | 512 | } |
| 513 | + |
513 | 514 | /** |
514 | 515 | * Insert image timestamps/SHA-1 keys into parser output |
515 | 516 | */ |
— | — | @@ -570,6 +571,10 @@ |
571 | 572 | return true; |
572 | 573 | } |
573 | 574 | |
| 575 | + protected static function getLocalFile( $title, $time ) { |
| 576 | + return RepoGroup::singleton()->getLocalRepo()->findFile( $title, $time ); |
| 577 | + } |
| 578 | + |
574 | 579 | /** |
575 | 580 | * Don't let users vandalize pages by moving them |
576 | 581 | */ |