r53040 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53039‎ | r53040 | r53041 >
Date:10:55, 10 July 2009
Author:thomasv
Status:deferred
Tags:
Comment:
access page and index namespaces through functions (bug 19447)
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -70,20 +70,41 @@
7171 $wgParser->setHook( "pagelist", "pr_renderPageList" );
7272 $wgParser->setHook( "pages", "pr_renderPages" );
7373 $wgParser->setHook( "pagequality", "pr_pageQuality" );
74 - wfLoadExtensionMessages( 'ProofreadPage' );
75 - $pr_page_namespace = preg_quote( wfMsgForContent( 'proofreadpage_namespace' ), '/' );
76 - $pr_index_namespace = preg_quote( wfMsgForContent( 'proofreadpage_index_namespace' ), '/' );
 74+ $pr_page_namespace = null;
 75+ $pr_index_namespace = null;
 76+}
7777
 78+
 79+/*
 80+ * accessor functions for page and index namespaces
 81+ */
 82+function pr_page_ns() {
 83+ global $pr_page_namespace;
 84+ if( is_null($pr_page_namespace) ) {
 85+ wfLoadExtensionMessages( 'ProofreadPage' );
 86+ $pr_page_namespace = preg_quote( wfMsgForContent( 'proofreadpage_namespace' ), '/' );
 87+ }
 88+ return $pr_page_namespace;
7889 }
7990
 91+function pr_index_ns() {
 92+ global $pr_index_namespace;
 93+ if( is_null($pr_index_namespace) ) {
 94+ wfLoadExtensionMessages( 'ProofreadPage' );
 95+ $pr_index_namespace = preg_quote( wfMsgForContent( 'proofreadpage_index_namespace' ), '/' );
 96+ }
 97+ return $pr_index_namespace;
 98+}
8099
81100
 101+
82102 /**
83103 * Query the database to find if the current page is referred in an Index page.
84104 */
85105 function pr_load_index( $title ) {
86 - global $pr_page_namespace, $pr_index_namespace;
87106
 107+ $page_namespace = pr_page_ns();
 108+ $index_namespace = pr_index_ns();
88109 $title->pr_index_title = NULL;
89110 $dbr = wfGetDB( DB_SLAVE );
90111 $result = $dbr->select(
@@ -98,7 +119,7 @@
99120
100121 while ( $x = $dbr->fetchObject( $result ) ) {
101122 $ref_title = Title::makeTitle( $x->page_namespace, $x->page_title );
102 - if ( preg_match( "/^$pr_index_namespace:(.*)$/", $ref_title->getPrefixedText() ) ) {
 123+ if ( preg_match( "/^$index_namespace:(.*)$/", $ref_title->getPrefixedText() ) ) {
103124 $title->pr_index_title = $ref_title->getPrefixedText();
104125 break;
105126 }
@@ -108,7 +129,7 @@
109130 if ( $title->pr_index_title ) return;
110131
111132 /*check if we are a page of a multipage file*/
112 - if ( preg_match( "/^$pr_page_namespace:(.*?)(\/([0-9]*)|)$/", $title->getPrefixedText(), $m ) ) {
 133+ if ( preg_match( "/^$page_namespace:(.*?)(\/([0-9]*)|)$/", $title->getPrefixedText(), $m ) ) {
113134 $imageTitle = Title::makeTitleSafe( NS_IMAGE, $m[1] );
114135 }
115136 if ( !$imageTitle ) return;
@@ -119,15 +140,13 @@
120141 if ( $image && $image->exists() && $image->isMultiPage() ) {
121142
122143 $name = $image->getTitle()->getText();
123 - $index_name = "$pr_index_namespace:$name";
 144+ $index_name = "$index_namespace:$name";
124145
125146 if ( !$title->pr_index_title ) {
126147 // there is no index, or the page is not listed in the index : use canonical index
127148 $title->pr_index_title = $index_name;
128149 }
129150 }
130 -
131 -
132151 }
133152
134153
@@ -135,7 +154,8 @@
136155 * return the URLs of the index, previous and next pages.
137156 */
138157 function pr_navigation( $title ) {
139 - global $pr_page_namespace, $pr_index_namespace;
 158+
 159+ $page_namespace = pr_page_ns();
140160 $default_header = wfMsgGetKey( 'proofreadpage_default_header', true, true, false );
141161 $default_footer = wfMsgGetKey( 'proofreadpage_default_footer', true, true, false );
142162
@@ -159,8 +179,8 @@
160180 return $err;
161181 }
162182 $name = $image->getTitle()->getText();
163 - $prev_name = "$pr_page_namespace:$name/" . ( $pagenr - 1 );
164 - $next_name = "$pr_page_namespace:$name/" . ( $pagenr + 1 );
 183+ $prev_name = "$page_namespace:$name/" . ( $pagenr - 1 );
 184+ $next_name = "$page_namespace:$name/" . ( $pagenr + 1 );
165185 $prev_url = ( $pagenr == 1 ) ? '' : Title::newFromText( $prev_name )->getFullURL();
166186 $next_url = ( $pagenr == $count ) ? '' : Title::newFromText( $next_name )->getFullURL();
167187
@@ -183,7 +203,7 @@
184204 $attributes["pagenum"] = $pagenum;
185205 } else {
186206 for( $i=0; $i<count( $links[1] ); $i++) {
187 - $a_title = Title::newFromText( $pr_page_namespace.":".$links[1][$i] );
 207+ $a_title = Title::newFromText( $page_namespace.":".$links[1][$i] );
188208 if(!$a_title) continue;
189209 if( $a_title->getPrefixedText() == $title->getPrefixedText() ) {
190210 $attributes["pagenum"] = $links[3][$i];
@@ -191,10 +211,10 @@
192212 }
193213 }
194214 if( ($i>0) && ($i<count($links[1])) ){
195 - $prev_title = Title::newFromText( $pr_page_namespace.":".$links[1][$i-1] );
 215+ $prev_title = Title::newFromText( $page_namespace.":".$links[1][$i-1] );
196216 }
197217 if( ($i>=0) && ($i+1<count($links[1])) ){
198 - $next_title = Title::newFromText( $pr_page_namespace.":".$links[1][$i+1] );
 218+ $next_title = Title::newFromText( $page_namespace.":".$links[1][$i+1] );
199219 }
200220 if($prev_title) $prev_url = $prev_title->getFullURL();
201221 if($next_title) $next_url = $next_title->getFullURL();
@@ -232,8 +252,8 @@
233253
234254
235255 function pr_parse_index_text( $text ){
236 - global $pr_page_namespace, $pr_index_namespace;
237256
 257+ $page_namespace = pr_page_ns();
238258 //check if it is using pagelist
239259 preg_match_all( "/<pagelist([^<]*?)\/>/is", $text, $m, PREG_PATTERN_ORDER );
240260 if( $m[1] ) {
@@ -245,7 +265,7 @@
246266 $links = null;
247267 } else {
248268 $params = null;
249 - $tag_pattern = "/\[\[$pr_page_namespace:(.*?)(\|(.*?)|)\]\]/i";
 269+ $tag_pattern = "/\[\[$page_namespace:(.*?)(\|(.*?)|)\]\]/i";
250270 preg_match_all( $tag_pattern, $text, $links, PREG_PATTERN_ORDER );
251271 }
252272
@@ -272,7 +292,6 @@
273293 */
274294 function pr_beforePageDisplay( &$out ) {
275295 global $wgTitle, $wgJsMimeType, $wgScriptPath, $wgRequest, $wgProofreadPageVersion;
276 - global $pr_page_namespace, $pr_index_namespace;
277296
278297 $action = $wgRequest->getVal( 'action' );
279298 $isEdit = ( $action == 'submit' || $action == 'edit' ) ? 1 : 0;
@@ -281,12 +300,14 @@
282301 }
283302 $out->proofreadPageDone = true;
284303
285 - if ( preg_match( "/^$pr_page_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText(), $m ) ) {
 304+ $page_namespace = pr_page_ns();
 305+ if ( preg_match( "/^$page_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText(), $m ) ) {
286306 pr_preparePage( $out, $m, $isEdit );
287307 return true;
288308 }
289309
290 - if ( $isEdit && ( preg_match( "/^$pr_index_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText(), $m ) ) ) {
 310+ $index_namespace = pr_index_ns();
 311+ if ( $isEdit && ( preg_match( "/^$index_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText(), $m ) ) ) {
291312 pr_prepareIndex( $out );
292313 return true;
293314 }
@@ -404,7 +425,6 @@
405426 * Hook function
406427 */
407428 function pr_getLinkColoursHook( $page_ids, &$colours ) {
408 - global $pr_page_namespace, $pr_index_namespace;
409429 global $wgTitle;
410430
411431 if ( !isset( $wgTitle ) ) {
@@ -412,7 +432,8 @@
413433 }
414434
415435 // abort if we are not an index page
416 - if ( !preg_match( "/^$pr_index_namespace:(.*?)$/", $wgTitle->getPrefixedText(), $m ) ) {
 436+ $index_namespace = pr_index_ns();
 437+ if ( !preg_match( "/^$index_namespace:(.*?)$/", $wgTitle->getPrefixedText(), $m ) ) {
417438 return true;
418439 }
419440 pr_getLinkColours( $page_ids, $colours );
@@ -424,13 +445,13 @@
425446 * Return the quality colour codes to pages linked from an index page
426447 */
427448 function pr_getLinkColours( $page_ids, &$colours ) {
428 - global $pr_page_namespace, $pr_index_namespace;
429449
 450+ $page_namespace = pr_page_ns();
430451 $dbr = wfGetDB( DB_SLAVE );
431452 $catlinks = $dbr->tableName( 'categorylinks' );
432453 foreach ( $page_ids as $id => $pdbk ) {
433454 // consider only link in page namespace
434 - if ( preg_match( "/^$pr_page_namespace:(.*?)$/", $pdbk ) ) {
 455+ if ( preg_match( "/^$page_namespace:(.*?)$/", $pdbk ) ) {
435456 $colours[$pdbk] = 'quality1';
436457 if ( !isset( $query ) ) {
437458 $query = "SELECT cl_from, cl_to FROM $catlinks WHERE cl_from IN(";
@@ -469,9 +490,9 @@
470491 }
471492
472493 function pr_imageMessage( &$imgpage , &$wgOut ) {
473 - global $pr_page_namespace, $pr_index_namespace;
474494 global $wgUser;
475495
 496+ $index_namespace = pr_index_ns();
476497 $image = $imgpage->img;
477498 if ( !$image->isMultiPage() ) {
478499 return true;
@@ -479,7 +500,7 @@
480501
481502 $sk = $wgUser->getSkin();
482503 $name = $image->getTitle()->getText();
483 - $link = $sk->makeKnownLink( "$pr_index_namespace:$name", wfMsg( 'proofreadpage_image_message' ) );
 504+ $link = $sk->makeKnownLink( "$index_namespace:$name", wfMsg( 'proofreadpage_image_message' ) );
484505 $wgOut->addHTML( "{$link}" );
485506
486507 return true;
@@ -488,6 +509,7 @@
489510
490511 // credit : http://www.mediawiki.org/wiki/Extension:RomanNumbers
491512 function toRoman( $num ) {
 513+
492514 if ( $num < 0 || $num > 9999 ) {
493515 return - 1;
494516 }
@@ -519,6 +541,7 @@
520542
521543
522544 function pr_pageNumber( $i, $args ) {
 545+
523546 $mode = 'normal'; // default
524547 $offset = 0;
525548 $links = true;
@@ -574,10 +597,10 @@
575598 * todo : display whether page has been proofread by the user or by someone else
576599 */
577600 function pr_pageQuality( $input, $args ) {
578 - global $pr_page_namespace, $pr_index_namespace;
579601 global $wgUser, $wgTitle, $wgParser;
580602
581 - if ( !preg_match( "/^$pr_page_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText() ) ) {
 603+ $page_namespace = pr_page_ns();
 604+ if ( !preg_match( "/^$page_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText() ) ) {
582605 return "";
583606 }
584607 $q = $args['level'];
@@ -595,10 +618,11 @@
596619 * Display a list of coloured links to pages
597620 */
598621 function pr_renderPageList( $input, $args ) {
599 - global $pr_page_namespace, $pr_index_namespace;
600622 global $wgUser, $wgTitle, $wgParser;
601623
602 - if ( !preg_match( "/^$pr_index_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText(), $m ) ) {
 624+ $page_namespace = pr_page_ns();
 625+ $index_namespace = pr_index_ns();
 626+ if ( !preg_match( "/^$index_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText(), $m ) ) {
603627 return "";
604628 }
605629
@@ -629,7 +653,7 @@
630654 }
631655
632656 for ( $i = $from; $i < $to + 1; $i++ ) {
633 - $pdbk = "$pr_page_namespace:$name" . '/' . $i ;
 657+ $pdbk = "$page_namespace:$name" . '/' . $i ;
634658 list( $view, $links, $mode ) = pr_pageNumber( $i, $args );
635659
636660 if ( $mode == 'highroman' || $mode == 'roman' ) $view = '&nbsp;' . $view;
@@ -662,9 +686,10 @@
663687 * It needs 3 parameters : index, from, to
664688 */
665689 function pr_renderPages( $input, $args ) {
666 - global $pr_page_namespace, $pr_index_namespace;
667690 global $wgParser, $wgTitle;
668691
 692+ $page_namespace = pr_page_ns();
 693+ $index_namespace = pr_index_ns();
669694 $index = $args['index'];
670695 $from = $args['from'];
671696 $to = $args['to'];
@@ -672,7 +697,7 @@
673698 if( ! $index ) {
674699 return '<strong class="error">' . wfMsgForContent( 'proofreadpage_index_expected' ) . '</strong>';
675700 }
676 - $index_title = Title::newFromText( "$pr_index_namespace:$index" );
 701+ $index_title = Title::newFromText( "$index_namespace:$index" );
677702 if( ! $index_title || ! $index_title->exists() ) {
678703 return '<strong class="error">' . wfMsgForContent( 'proofreadpage_nosuch_index' ) . '</strong>';
679704 }
@@ -705,7 +730,7 @@
706731 }
707732
708733 for( $i=$from; $i<=$to;$i++ ) {
709 - $text = "$pr_page_namespace:$index/" . $i;
 734+ $text = "$page_namespace:$index/" . $i;
710735 list($pagenum, $links, $mode) = pr_pageNumber($i,$params);
711736 $out.= "<span>{{:MediaWiki:Proofreadpage_pagenum_template|page=".$text."|num=$pagenum}}</span>";
712737 if( $args["$i"] != null){
@@ -732,13 +757,13 @@
733758 if($text == $from ) $adding = true;
734759 if($adding){
735760 $out.= "<span>{{:MediaWiki:Proofreadpage_pagenum_template|page="
736 - .$pr_page_namespace.":".$text."|num=$pagenum}}</span>";
 761+ .$page_namespace.":".$text."|num=$pagenum}}</span>";
737762 if($text == $from && $args["fromsection"]){
738 - $out.= "{{#lst:".$pr_page_namespace.":".$text."|".$args["fromsection"]."}}";
 763+ $out.= "{{#lst:".$page_namespace.":".$text."|".$args["fromsection"]."}}";
739764 } else if($text == $to && $args["tosection"]){
740 - $out.= "{{#lst:".$pr_page_namespace.":".$text."|".$args["tosection"]."}}";
 765+ $out.= "{{#lst:".$page_namespace.":".$text."|".$args["tosection"]."}}";
741766 } else {
742 - $out.= "{{:".$pr_page_namespace.":".$text."}}";
 767+ $out.= "{{:".$page_namespace.":".$text."}}";
743768 }
744769 }
745770 if($text == $to ) $adding = false;
@@ -755,8 +780,8 @@
756781 */
757782 function pr_parse_page( $text ) {
758783 global $wgTitle, $wgUser;
 784+
759785 $username = $wgUser->getName();
760 -
761786 $page_regexp = "/^<noinclude>(.*?)<\/noinclude>(.*?)<noinclude>(.*?)<\/noinclude>$/s";
762787 if( !preg_match( $page_regexp, $text, $m ) ) {
763788 pr_load_index( $wgTitle );
@@ -783,10 +808,10 @@
784809
785810 function pr_formData( $editpage, $request ) {
786811 global $wgTitle;
787 - global $pr_page_namespace;
788812
 813+ $page_namespace = pr_page_ns();
789814 //abort if we are not a page
790 - if ( ! preg_match( "/^$pr_page_namespace:(.*)$/", $wgTitle->getPrefixedText() ) ) {
 815+ if ( ! preg_match( "/^$page_namespace:(.*)$/", $wgTitle->getPrefixedText() ) ) {
791816 return true;
792817 }
793818 if ( ! $request->wasPosted() ) {
@@ -824,13 +849,14 @@
825850 * Check the format of pages in "Page" namespace.
826851 */
827852 function pr_attemptSave( $editpage ) {
828 - global $pr_page_namespace, $pr_index_namespace;
829853 global $wgOut, $wgUser;
830854
 855+ $page_namespace = pr_page_ns();
 856+ $index_namespace = pr_index_ns();
831857 $title = $editpage->mTitle;
832858
833859 //check that pages listed on an index are unique.
834 - if ( preg_match( "/^$pr_index_namespace:(.*)$/", $title->getPrefixedText() ) ) {
 860+ if ( preg_match( "/^$index_namespace:(.*)$/", $title->getPrefixedText() ) ) {
835861 $text = $editpage->textbox1;
836862 list( $links, $params, $attributes ) = pr_parse_index_text($text);
837863 if( $links!=null && count($links[1]) != count( array_unique($links[1]))) {
@@ -841,7 +867,7 @@
842868 }
843869
844870 //abort if we are not a page
845 - if ( ! preg_match( "/^$pr_page_namespace:(.*)$/", $title->getPrefixedText() ) ) {
 871+ if ( ! preg_match( "/^$page_namespace:(.*)$/", $title->getPrefixedText() ) ) {
846872 return true;
847873 }
848874
@@ -895,11 +921,12 @@
896922 * if I delete an index page too...
897923 */
898924 function pr_articleDelete( $article ) {
899 - global $pr_page_namespace, $pr_index_namespace;
900925
 926+ $page_namespace = pr_page_ns();
 927+ $index_namespace = pr_index_ns();
901928 $title = $article->mTitle;
902929
903 - if ( preg_match( "/^$pr_index_namespace:(.*)$/", $title->getPrefixedText() ) ) {
 930+ if ( preg_match( "/^$index_namespace:(.*)$/", $title->getPrefixedText() ) ) {
904931 $id = $article->getID();
905932 $dbw = wfGetDB( DB_MASTER );
906933 $pr_index = $dbw->tableName( 'pr_index' );
@@ -908,7 +935,7 @@
909936 return true;
910937 }
911938
912 - if ( preg_match( "/^$pr_page_namespace:(.*)$/", $title->getPrefixedText() ) ) {
 939+ if ( preg_match( "/^$page_namespace:(.*)$/", $title->getPrefixedText() ) ) {
913940 pr_load_index( $title );
914941 if( $title->pr_index_title ) {
915942 $index_title = Title::newFromText( $title->pr_index_title );
@@ -925,18 +952,19 @@
926953
927954
928955 function pr_articleSaveComplete( $article ) {
929 - global $pr_page_namespace, $pr_index_namespace;
930956
 957+ $page_namespace = pr_page_ns();
 958+ $index_namespace = pr_index_ns();
931959 $title = $article->mTitle;
932960
933961 //if it's an index, update pr_index table
934 - if ( preg_match( "/^$pr_index_namespace:(.*)$/", $title->getPrefixedText(), $m ) ) {
 962+ if ( preg_match( "/^$index_namespace:(.*)$/", $title->getPrefixedText(), $m ) ) {
935963 pr_update_pr_index( $article );
936964 return true;
937965 }
938966
939967 //return if it is not a page
940 - if ( ! preg_match( "/^$pr_page_namespace:(.*)$/", $title->getPrefixedText() ) ) {
 968+ if ( ! preg_match( "/^$page_namespace:(.*)$/", $title->getPrefixedText() ) ) {
941969 return true;
942970 }
943971
@@ -1004,10 +1032,10 @@
10051033
10061034 /* preload Djvu Text */
10071035 function pr_preloadText( $textbox1, $mTitle ) {
1008 - global $pr_page_namespace, $pr_index_namespace;
10091036 global $wgDjvuTxt;
10101037
1011 - if ( $wgDjvuTxt && preg_match( "/^$pr_page_namespace:(.*?)\/([0-9]*)$/", $mTitle->getPrefixedText(), $m ) ) {
 1038+ $page_namespace = pr_page_ns();
 1039+ if ( $wgDjvuTxt && preg_match( "/^$page_namespace:(.*?)\/([0-9]*)$/", $mTitle->getPrefixedText(), $m ) ) {
10121040 $imageTitle = Title::makeTitleSafe( NS_IMAGE, $m[1] );
10131041 if ( !$imageTitle ) {
10141042 return true;
@@ -1029,9 +1057,9 @@
10301058
10311059
10321060 function pr_movePage( $form, $ot, $nt ) {
1033 - global $pr_page_namespace, $pr_index_namespace;
10341061
1035 - if ( preg_match( "/^$pr_page_namespace:(.*)$/", $ot->getPrefixedText() ) ) {
 1062+ $page_namespace = pr_page_ns();
 1063+ if ( preg_match( "/^$page_namespace:(.*)$/", $ot->getPrefixedText() ) ) {
10361064 pr_load_index( $ot );
10371065 if( $ot->pr_index_title ) {
10381066 $index_title = Title::newFromText( $ot->pr_index_title );
@@ -1042,7 +1070,7 @@
10431071 return true;
10441072 }
10451073
1046 - if ( preg_match( "/^$pr_page_namespace:(.*)$/", $nt->getPrefixedText() ) ) {
 1074+ if ( preg_match( "/^$page_namespace:(.*)$/", $nt->getPrefixedText() ) ) {
10471075 pr_load_index( $nt );
10481076 if( $nt->pr_index_title && ($nt->pr_index_title!=$ot->pr_index_title) ) {
10491077 $index_title = Title::newFromText( $nt->pr_index_title );
@@ -1060,10 +1088,10 @@
10611089 * When an index page is created or purged, recompute pr_index values
10621090 */
10631091 function pr_articlePurge( $article ) {
1064 - global $pr_page_namespace, $pr_index_namespace;
10651092
 1093+ $index_namespace = pr_index_ns();
10661094 $title = $article->mTitle;
1067 - if ( preg_match( "/^$pr_index_namespace:(.*)$/", $title->getPrefixedText() ) ) {
 1095+ if ( preg_match( "/^$index_namespace:(.*)$/", $title->getPrefixedText() ) ) {
10681096 pr_update_pr_index( $article );
10691097 return true;
10701098 }
@@ -1076,9 +1104,10 @@
10771105 * update the pr_index entry of an article
10781106 */
10791107 function pr_update_pr_index( $index, $deletedpage=null ) {
1080 - global $pr_page_namespace, $pr_index_namespace;
10811108
1082 - $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) );
 1109+ $page_namespace = pr_page_ns();
 1110+ $index_namespace = pr_index_ns();
 1111+ $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $page_namespace ) );
10831112 if ( $page_ns_index == NULL ) {
10841113 return;
10851114 }
@@ -1171,7 +1200,6 @@
11721201 */
11731202 function pr_OutputPageBeforeHTML( $out, $text ) {
11741203 global $wgTitle, $wgUser;
1175 - global $pr_page_namespace, $pr_index_namespace;
11761204
11771205 if($wgTitle->getNamespace() != NS_MAIN){
11781206 return true;
@@ -1182,8 +1210,10 @@
11831211 return true;
11841212 }
11851213
1186 - $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_page_namespace ) );
1187 - $index_ns_index = MWNamespace::getCanonicalIndex( strtolower( $pr_index_namespace ) );
 1214+ $page_namespace = pr_page_ns();
 1215+ $index_namespace = pr_index_ns();
 1216+ $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $page_namespace ) );
 1217+ $index_ns_index = MWNamespace::getCanonicalIndex( strtolower( $index_namespace ) );
11881218 if( $page_ns_index==null || $index_ns_index == null){
11891219 return true;
11901220 }
@@ -1254,7 +1284,7 @@
12551285 $dbr->freeResult( $res );
12561286 }
12571287 $sk = $wgUser->getSkin();
1258 - $indexlink = $sk->makeKnownLink( "$pr_index_namespace:$title", "[index]" );
 1288+ $indexlink = $sk->makeKnownLink( "$index_namespace:$title", "[index]" );
12591289 $output = wfMsgForContent( 'proofreadpage_quality_message', $n0, $n1, $n2, $n3, $n4, $n, $indexlink );
12601290 $out->setSubtitle($output);
12611291 return true;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52730(bug 19447) Disable the localisation store backend during install and update.tstarling06:56, 3 July 2009

Status & tagging log