r67848 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67847‎ | r67848 | r67849 >
Date:10:41, 11 June 2010
Author:liangent
Status:deferred
Tags:
Comment:
Do not change blank strings to 0 when type is int -- leave them blank
Modified paths:
  • /trunk/extensions/CategoryMultisort/CategoryMultisort.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryMultisort/CategoryMultisort.class.php
@@ -106,13 +106,15 @@
107107 }
108108 }
109109
 110+ $sortkey = trim( $sortkey );
 111+
110112 $type = array_key_exists( 'type', $this->sortkeySettings )
111113 ? $this->sortkeySettings['type'] : '';
112114
113 - if ( $type == 'int' ) {
 115+ if ( $type == 'int' && $sortkey != '' ) {
114116 $sortkey = strval( intval( $sortkey ) );
115117 }
116118
117 - return $wgContLang->convert( trim( $sortkey ) );
 119+ return $wgContLang->convert( $sortkey );
118120 }
119121 }

Status & tagging log