Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -530,7 +530,9 @@ |
531 | 531 | # Get parsed current version |
532 | 532 | $parserCache = ParserCache::singleton(); |
533 | 533 | $currentOutput = $parserCache->get( $article, $wgUser ); |
534 | | - if( $currentOutput==false ) { |
| 534 | + # If $text is set, then the stableOutput is new. In that case, |
| 535 | + # the current must also be new to avoid sync goofs. |
| 536 | + if( $currentOutput==false || isset($text) ) { |
535 | 537 | $text = $article->getContent(); |
536 | 538 | $title = $article->getTitle(); |
537 | 539 | $options = self::makeParserOptions(); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -365,6 +365,7 @@ |
366 | 366 | if( empty($parser->fr_isStable) ) { |
367 | 367 | return true; |
368 | 368 | } |
| 369 | + $file = null; |
369 | 370 | $dbr = wfGetDB( DB_SLAVE ); |
370 | 371 | # Normalize NS_MEDIA to NS_IMAGE |
371 | 372 | $title = $nt->getNamespace() == NS_IMAGE ? $nt : Title::makeTitle( NS_IMAGE, $nt->getDBKey() ); |
— | — | @@ -421,7 +422,9 @@ |
422 | 423 | # Add image metadata to parser output |
423 | 424 | $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()] = array(); |
424 | 425 | $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()][$time] = $sha1; |
425 | | - if( $time > $parser->mOutput->fr_newestImageTime ) { |
| 426 | + # Bug 15748, be lax about commons image sync status |
| 427 | + $file = $file ? $file : wfFindFile( $title, $time ); # FIXME: would be nice not to double fetch! |
| 428 | + if( $file && $file->isLocal() && $time > $parser->mOutput->fr_newestImageTime ) { |
426 | 429 | $parser->mOutput->fr_newestImageTime = $time; |
427 | 430 | } |
428 | 431 | return true; |
— | — | @@ -435,6 +438,7 @@ |
436 | 439 | if( empty($ig->mParser->fr_isStable) || $nt->getNamespace() != NS_IMAGE ) { |
437 | 440 | return true; |
438 | 441 | } |
| 442 | + $file = null; |
439 | 443 | $dbr = wfGetDB( DB_SLAVE ); |
440 | 444 | # Check for stable version of image if this feature is enabled. |
441 | 445 | # Should be in reviewable namespace, this saves unneeded DB checks as |
— | — | @@ -489,7 +493,9 @@ |
490 | 494 | # Add image metadata to parser output |
491 | 495 | $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()] = array(); |
492 | 496 | $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()][$time] = $sha1; |
493 | | - if( $time > $ig->mParser->mOutput->fr_newestImageTime ) { |
| 497 | + # Bug 15748, be lax about commons image sync status |
| 498 | + $file = $file ? $file : wfFindFile( $title, $time ); # FIXME: would be nice not to double fetch! |
| 499 | + if( $file && $file->isLocal() && $time > $ig->mParser->mOutput->fr_newestImageTime ) { |
494 | 500 | $ig->mParser->mOutput->fr_newestImageTime = $time; |
495 | 501 | } |
496 | 502 | return true; |
— | — | @@ -524,7 +530,8 @@ |
525 | 531 | $file = wfFindFile( Title::makeTitle( NS_IMAGE, $filename ) ); |
526 | 532 | $parser->mOutput->fr_ImageSHA1Keys[$filename] = array(); |
527 | 533 | if( $file ) { |
528 | | - if( $file->getTimestamp() > $maxTimestamp ) { |
| 534 | + # Bug 15748, be lax about commons image sync status |
| 535 | + if( $file->isLocal() && $file->getTimestamp() > $maxTimestamp ) { |
529 | 536 | $maxTimestamp = $file->getTimestamp(); |
530 | 537 | } |
531 | 538 | $parser->mOutput->fr_ImageSHA1Keys[$filename][$file->getTimestamp()] = $file->getSha1(); |