Content deleted Content added
Updating published sources: PERTableUpdater: * Try to escape unmatched left-braces that Perl complains about when processing blacklist. |
Updating published sources: PERTableUpdater: * Only log about bad regexes once per day. |
||
Line 92:
}
$api->store->{"ver"} = 2;
}
# Flush warnings daily
my $ts = time;
$ts -= $ts % 86400;
if ( ($api->store->{'warnedBadRegexDate'} // 0) < $ts) {
$api->store->{'warnedBadRegex'} = {};
$api->store->{'warnedBadRegexDate'} = $ts;
}
Line 137 ⟶ 145:
my $tmp = $re;
$re=~s#(?<!\\[a-zA-Z])(?<!\\)\{(?!\d+(?:,\d*)?})#\\{#g;
$
$
# Validate each line, in case someone screws up the blacklist page
Line 145 ⟶ 153:
};
if ( $@ ) {
$
next;
}
Line 457 ⟶ 465:
$t=0 if $t<0;
return $t;
}
sub warnBadRegex {
my ($self, $api, $msg) = @_;
my $warned = $api->store->{'warnedBadRegex'};
return if exists( $warned->{$msg} );
$warned->{$msg} = 1;
$api->store->{'warnedBadRegex'} = $warned;
$api->warn( $msg );
}
|