r64946 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64945‎ | r64946 | r64947 >
Date:20:40, 11 April 2010
Author:svip
Status:deferred
Tags:
Comment:
Allowed any amount of full stops in intervals, e.g. 0...10 is now also legal.
Modified paths:
  • /trunk/extensions/NaturalLanguageList/NaturalLanguageList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NaturalLanguageList/NaturalLanguageList.php
@@ -419,12 +419,13 @@
420420 * @param $array Array The array with values.
421421 * @param $value Mixed The element to be verified.
422422 * @param $intervals Boolean Whether intervals are allowed.
 423+ * @return Boolean True on interval was A-OK, otherwise false.
423424 */
424425 private static function handle_interval ( &$array, $value, $intervals ) {
425426 global $wgNllMaxListLength;
426427 if ( !$intervals )
427428 return false;
428 - $tmp = explode ( "..", $value );
 429+ $tmp = explode ( "..", preg_replace( "/([0-9]+)\.\.+([0-9]+)/", '$1..$2', $value ) );
429430 if ( count( $tmp ) == 2 ) {
430431 if ( is_numeric($tmp[0])===false or is_numeric($tmp[1])===false or ($tmp[0] > $tmp[1]) )
431432 return false;

Status & tagging log