r52754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52753‎ | r52754 | r52755 >
Date:20:47, 3 July 2009
Author:thomasv
Status:deferred
Tags:
Comment:
rm unneeded code; check for page_ns_index not null
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -621,14 +621,7 @@
622622 $return = "";
623623 $name = $imageTitle->getDBkey();
624624 $count = $image->pageCount();
625 - $dbr = wfGetDB( DB_SLAVE );
626 - $pagetable = $dbr->tableName( 'page' );
627625
628 - $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) );
629 - if ( $page_ns_index == NULL ) {
630 - $page_ns_index = NS_MAIN;
631 - }
632 -
633626 $from = $args['from'];
634627 $to = $args['to'];
635628 if( !$from ) $from = 1;
@@ -1056,6 +1049,11 @@
10571050 function pr_update_pr_index( $index, $deletedpage=null ) {
10581051 global $pr_page_namespace, $pr_index_namespace;
10591052
 1053+ $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) );
 1054+ if ( $page_ns_index == NULL ) {
 1055+ return;
 1056+ }
 1057+
10601058 $index_title = $index->mTitle;
10611059 $index_id = $index->getID();
10621060
@@ -1087,7 +1085,6 @@
10881086 $catlinks = $dbr->tableName( 'categorylinks' );
10891087 $page = $dbr->tableName( 'page' );
10901088 $pagelist = "'".implode( "', '", $pages)."'";
1091 - $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) );
10921089 $query = "SELECT COUNT(page_id) AS count FROM $page LEFT JOIN $catlinks ON cl_from=page_id WHERE cl_to='###' AND page_namespace=$page_ns_index AND page_title IN ( $pagelist )" ;
10931090
10941091 $q0 = str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality0_category' ) );

Status & tagging log