Permalink
Browse files

Temporary fix for regex

Really this part of the system is very old and the whole thing should be fixed up, but in the meantime, this will prevent it from hating on long strings.
  • Loading branch information...
1 parent 0d03369 commit 9f5ece03d8676a21215551d25d3ea0e1ab322902 @pudge pudge committed May 25, 2008
Showing with 5 additions and 1 deletion.
  1. +5 −1 Slash/Utility/Access/Access.pm
@@ -461,7 +461,11 @@ sub filterOk {
if ($minimum_match) {
$number_match = "{$minimum_match,}";
} elsif ($ratio > 0) {
- $number_match = "{" . int(length($text_to_test)*$ratio + 1) . ",}";
+ my $num = int(length($text_to_test)*$ratio + 1);
+ my $max = 2**15-1;
+ # temporary fix 2008-05-23
+ $num = $max if $num >= $max;
+ $number_match = "{$num,}";
} else {
$number_match = "";
}

0 comments on commit 9f5ece0

Please sign in to comment.