r60310 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60309‎ | r60310 | r60311 >
Date:09:47, 23 December 2009
Author:kim
Status:ok
Tags:
Comment:
minor changes by bawolff
"I've made some fixes to the copy of GNSM. Basically fixes to stupid
little things (using the wrong capitilization on a variable, a debug
statement that was left in, etc)."
Modified paths:
  • /trunk/extensions/GNSM/SpecialGNSM_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GNSM/SpecialGNSM_body.php
@@ -134,7 +134,8 @@
135135 $title = Title::makeTitle( $row->page_namespace, $row->page_title);
136136
137137 if ( $title ){
138 - print $this->params['nameSpace'];
 138+ //This is printing things in places it shouldn't
 139+ // print $this->params['nameSpace'];
139140
140141 $titleText = ( true == $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText();
141142
@@ -289,7 +290,7 @@
290291 $this->params['orderMethod'] = 'categoryadd';
291292 $this->params['order'] = 'descending';
292293 $this->params['redirects'] = 'exclude';
293 - $this->params['stable'] = $quality = 'only';
 294+ $this->params['stable'] = $this->params['quality'] = 'only';
294295
295296 $this->params['nameSpace'] = false;
296297 $this->params['iNameSpace'] = 0;
@@ -456,7 +457,7 @@
457458 $this->params['notCatCount'] = count( $this->notCategories );
458459 $totalCatCount = $this->params['catCount'] + $this->params['notCatCount'];
459460
460 - if (( $this->params['catCount'] < 1 && false == $this->params['nameSpace'] ) || ( $totalCatCount < $this->wgDPLminCategories )){
 461+ if (( $this->params['catCount'] < 1 && false == $this->params['nameSpace'] ) || ( $totalCatCount < $this->wgDPlminCategories )){
461462 //echo "Boom on catCount\n";
462463 $parser = new Parser;
463464 $poptions = new ParserOptions;
@@ -501,16 +502,18 @@
502503 $list = explode( "\n*", "\n$msg");
503504 foreach($list as $item) {
504505 $mapping = explode('|', $item, 2);
505 - if ( trim( $mapping[1] ) == '__MASK__') {
506 - $catMask[trim($mapping[0])] = true;
507 - } else {
508 - $catMap[trim($mapping[0])] = trim($mapping[1]);
 506+ if ( count( $mapping ) == 2 ) {
 507+ if ( trim( $mapping[1] ) == '__MASK__') {
 508+ $catMask[trim($mapping[0])] = true;
 509+ } else {
 510+ $catMap[trim($mapping[0])] = trim($mapping[1]);
 511+ }
509512 }
510513 }
511514 }
512515 foreach ( $cats as $key => $val ){
513516 $cat = str_replace( '_', ' ', trim( substr( $key, strpos( $key, ':' ) + 1 ) ) );
514 - if (!$catMask[$cat]) {
 517+ if (!isset($catMask[$cat])) {
515518 if (isset($catMap[$cat])) {
516519 $str .= ', ' . str_replace( '_', ' ', trim ( $catMap[$cat] ) );
517520 } else {

Status & tagging log