r64740 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64739‎ | r64740 | r64741 >
Date:09:55, 8 April 2010
Author:svip
Status:ok
Tags:
Comment:
Follow up to broken code of r64739, all bugs should be clear now.
Modified paths:
  • /trunk/extensions/NaturalLanguageList/NaturalLanguageList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NaturalLanguageList/NaturalLanguageList.php
@@ -379,9 +379,9 @@
380380 private static function handle_interval ( &$array, $intervals, $value ) {
381381 if ( !$intervals )
382382 return false;
383 - if ( preg_match("@[1-9][0-9]*\.\.[1-9][0-9]*@is", $value ) ) {
384 - $tmp = explode ( "|", preg_replace("@([1-9][0-9]*)\.\.([1-9][0-9]*)@is", "$1|$2", $value);
385 - if ( !is_numeric($tmp[0]) or !is_numeric($tmp[1]) or $tmp[0] > $tmp[1] )
 383+ if ( preg_match("@[0-9]+\.\.[1-9][0-9]*@is", $value ) ) {
 384+ $tmp = explode ( "|", preg_replace("@([0-9]+)\.\.([1-9][0-9]*)@is", "$1|$2", $value) );
 385+ if ( is_numeric($tmp[0])===false or is_numeric($tmp[1])===false or ($tmp[0] > $tmp[1]) )
386386 return false;
387387 for ( $i = $tmp[0]; $i <= $tmp[1]; $i++ )
388388 $array[] = $i;

Follow-up revisions

RevisionCommit summaryAuthorDate
r64742Following up on r64739 and r64740; adding a global parameter to prevent crea...svip10:44, 8 April 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64739Created 'intervals' and 'length' parameters/features.svip09:45, 8 April 2010

Status & tagging log