r52752 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52751‎ | r52752 | r52753 >
Date:20:36, 3 July 2009
Author:thomasv
Status:deferred
Tags:
Comment:
do not run the query if or is null
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -673,8 +673,6 @@
674674 /*
675675 * Parser hook that includes a list of pages.
676676 * It needs 3 parameters : index, from, to
677 - *
678 - * todo : handle LST...
679677 */
680678 function pr_renderPages( $input, $args ) {
681679 global $pr_page_namespace, $pr_index_namespace;
@@ -1158,14 +1156,18 @@
11591157 return true;
11601158 }
11611159
 1160+ $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) );
 1161+ $index_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_index_namespace ) );
 1162+ if( $page_ns_index==null ){
 1163+ return true;
 1164+ }
 1165+
11621166 $dbr = wfGetDB( DB_SLAVE );
11631167 $pr_index = $dbr->tableName( 'pr_index' );
11641168 $page = $dbr->tableName( 'page' );
11651169 $pagelinks = $dbr->tableName( 'pagelinks' );
11661170 $templatelinks = $dbr->tableName( 'templatelinks' );
11671171 $catlinks = $dbr->tableName( 'categorylinks' );
1168 - $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) );
1169 - $index_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_index_namespace ) );
11701172
11711173 # count transclusions from page namespace
11721174 $query = "SELECT COUNT(page_id) AS count FROM templatelinks LEFT JOIN $page ON page_title=tl_title where tl_from=$id and tl_namespace=$page_ns_index";

Status & tagging log