r36437 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36436‎ | r36437 | r36438 >
Date:01:06, 19 June 2008
Author:aaron
Status:old
Tags:
Comment:
* Clear dead flaggedpages links (bug 14589)
* Be less strict on template reviewing (bug 14580)
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -1183,6 +1183,10 @@
11841184 global $wgUseStableTemplates;
11851185 $sv = FlaggedRevision::newFromStable( $linksUpdate->mTitle, !$wgUseStableTemplates, true );
11861186 if( !$sv ) {
 1187+ $dbw = wfGetDB( DB_MASTER );
 1188+ $dbw->delete( 'flaggedpages',
 1189+ array( 'fp_page_id' => $linksUpdate->mTitle->getArticleId() ),
 1190+ __METHOD__ );
11871191 wfProfileOut( __METHOD__ );
11881192 return true;
11891193 }
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php
@@ -504,19 +504,24 @@
505505 $flaggedOutput = FlaggedRevs::parseStableText( $article, $oldfrev->getTextForParse(), $oldfrev->getRevId() );
506506 }
507507
 508+ # Be looser on includes for templates, since they don't matter much
 509+ # and strict checking breaks randomized images/metatemplates...(bug 14580)
 510+ global $wgUseCurrentTemplates, $wgUseCurrentImages;
 511+ $noMatch = ($rev->getTitle()->getNamespace() == NS_TEMPLATE && $wgUseCurrentTemplates && $wgUseCurrentImages);
 512+
508513 # Set our versioning params cache
509514 FlaggedRevs::setIncludeVersionCache( $rev->getId(), $tmpParams, $imgParams );
510515 # Get the expanded text and resolve all templates.
511516 # Store $templateIDs and add it to final parser output later...
512517 list($fulltext,$tmps,$tmpIDs,$err,$maxID) = FlaggedRevs::expandText( $rev->getText(), $rev->getTitle(), $rev->getId() );
513 - if( !empty($err) || $maxID > $lastTempID ) {
 518+ if( !$noMatch && (!empty($err) || $maxID > $lastTempID) ) {
514519 wfProfileOut( __METHOD__ );
515520 return $err;
516521 }
517522 # Parse the rest and check if it matches up
518523 $stableOutput = FlaggedRevs::parseStableText( $article, $fulltext, $rev->getId(), false );
519524 $err =& $stableOutput->fr_includeErrors;
520 - if( !empty($err) || $stableOutput->fr_newestImageTime > $lastImgTime ) {
 525+ if( !$noMatch && (!empty($err) || $stableOutput->fr_newestImageTime > $lastImgTime) ) {
521526 wfProfileOut( __METHOD__ );
522527 return $err;
523528 }

Status & tagging log