r48848 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48847‎ | r48848 | r48849 >
Date:01:30, 26 March 2009
Author:werdna
Status:ok
Tags:
Comment:
Patch by Robert Rohde to prevent empty-string matches of a regex intended to match numbers
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.parser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/AbuseFilter.parser.php
@@ -963,7 +963,7 @@
964964 10 => '[0-9.]',
965965 );
966966 $baseClass = '['.implode('', array_keys($bases)).']';
967 - $radixRegex = "/([0-9A-Fa-f]*(?:\.\d*)?)($baseClass)?/Au";
 967+ $radixRegex = "/([0-9A-Fa-f]+(?:\.\d*)?|\.\d+)($baseClass)?/Au";
968968 $matches = array();
969969
970970 if ( preg_match( $radixRegex, $code, $matches, 0, $offset ) ) {

Status & tagging log