Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 9f5ece03d8676a21215551d25d3ea0e1ab322902 1 parent 0d03369
@pudge pudge authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 Slash/Utility/Access/Access.pm
View
6 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 = "";
}
Please sign in to comment.
Something went wrong with that request. Please try again.