r19227 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19226‎ | r19227 | r19228 >
Date:10:55, 14 January 2007
Author:brion
Status:old
Tags:
Comment:
Temporary(?) optimization; only update templatelinks on view if the page has cascading restrictions.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -2829,7 +2829,13 @@
28302830 $parserCache->save( $parserOutput, $this, $wgUser );
28312831 }
28322832
2833 - if ( !wfReadOnly() ) {
 2833+ if ( !wfReadOnly() && $this->mTitle->areRestrictionsCascading() ) {
 2834+ // templatelinks table may have become out of sync,
 2835+ // especially if using variable-based transclusions.
 2836+ // For paranoia, check if things have changed and if
 2837+ // so apply updates to the database. This will ensure
 2838+ // that cascaded protections apply as soon as the changes
 2839+ // are visible.
28342840
28352841 # Get templates from templatelinks
28362842 $id = $this->mTitle->getArticleID();