mirror of
https://github.com/pragma-/pbot.git
synced 2025-05-05 22:27:25 +02:00
Do not allow RE2 to fallback to PCRE
This commit is contained in:
parent
7fa458ab34
commit
cebcafba70
@ -753,7 +753,7 @@ sub factchange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $ret = eval {
|
my $ret = eval {
|
||||||
use re::engine::RE2;
|
use re::engine::RE2 -strict => 1;
|
||||||
if(not $factoids->{$channel}->{$trigger}->{action} =~ s|$tochange|$changeto|) {
|
if(not $factoids->{$channel}->{$trigger}->{action} =~ s|$tochange|$changeto|) {
|
||||||
$self->{pbot}->logger->log("($from) $nick!$user\@$host: failed to change '$trigger' 's$delim$tochange$delim$changeto$delim\n");
|
$self->{pbot}->logger->log("($from) $nick!$user\@$host: failed to change '$trigger' 's$delim$tochange$delim$changeto$delim\n");
|
||||||
return "/msg $nick Change $trigger failed.";
|
return "/msg $nick Change $trigger failed.";
|
||||||
|
@ -13,8 +13,8 @@ use warnings;
|
|||||||
# These are set automatically by the build/commit script
|
# These are set automatically by the build/commit script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 558,
|
BUILD_REVISION => 559,
|
||||||
BUILD_DATE => "2014-04-28",
|
BUILD_DATE => "2014-04-29",
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -524,7 +524,7 @@ if($subcode =~ m/^\s*(?:and\s+)?(run|paste)\s*$/i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($#replacements > -1) {
|
if($#replacements > -1) {
|
||||||
use re::engine::RE2;
|
use re::engine::RE2 -strict => 1;
|
||||||
@replacements = sort { $a->{'from'} cmp $b->{'from'} or $a->{'modifier'} <=> $b->{'modifier'} } @replacements;
|
@replacements = sort { $a->{'from'} cmp $b->{'from'} or $a->{'modifier'} <=> $b->{'modifier'} } @replacements;
|
||||||
|
|
||||||
my ($previous_from, $previous_modifier);
|
my ($previous_from, $previous_modifier);
|
||||||
@ -578,7 +578,7 @@ if($subcode =~ m/^\s*(?:and\s+)?(run|paste)\s*$/i) {
|
|||||||
my $count = 0;
|
my $count = 0;
|
||||||
my $unescaped = $from;
|
my $unescaped = $from;
|
||||||
$unescaped =~ s/\\//g;
|
$unescaped =~ s/\\//g;
|
||||||
if($code =~ s/($first_bound)$from($last_bound)/if(++$count == $modifier) { "$1$to$2"; } else { "$1$unescaped$2"; }/gex) {
|
if($code =~ s/($first_bound)$from($last_bound)/if(++$count == $modifier) { "$1$to$2"; } else { "$1$unescaped$2"; }/ge) {
|
||||||
$got_change = 1;
|
$got_change = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user