mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-23 11:12:42 +01:00
Add unquote_spaces
factoid module metadata to remove escaped quotes from quotemeta, and allow g modifier to modulelauncher_subpattern
This commit is contained in:
parent
08e300bd54
commit
f003ff1178
@ -64,11 +64,21 @@ sub execute_module {
|
||||
|
||||
$arguments = quotemeta($arguments);
|
||||
|
||||
if(exists $self->{pbot}->factoids->factoids->hash->{$channel}->{$trigger}->{unquote_spaces}) {
|
||||
$arguments =~ s/\\ / /g;
|
||||
}
|
||||
|
||||
if(exists $self->{pbot}->factoids->factoids->hash->{$channel}->{$trigger}->{modulelauncher_subpattern}) {
|
||||
if($self->{pbot}->factoids->factoids->hash->{$channel}->{$trigger}->{modulelauncher_subpattern} =~ m/s\/(.*?)\/(.*)\//) {
|
||||
my ($p1, $p2) = ($1, $2);
|
||||
if($self->{pbot}->factoids->factoids->hash->{$channel}->{$trigger}->{modulelauncher_subpattern} =~ m/s\/(.*?)\/(.*)\/(.*)/) {
|
||||
my ($p1, $p2, $p3) = ($1, $2, $3);
|
||||
my ($a, $b, $c, $d, $e, $f, $g, $h, $i, $before, $after);
|
||||
if($p3 eq 'g') {
|
||||
$arguments =~ s/$p1/$p2/g;
|
||||
($a, $b, $c, $d, $e, $f, $g, $h, $i, $before, $after) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $`, $');
|
||||
} else {
|
||||
$arguments =~ s/$p1/$p2/;
|
||||
my ($a, $b, $c, $d, $e, $f, $g, $h, $i, $before, $after) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $`, $');
|
||||
($a, $b, $c, $d, $e, $f, $g, $h, $i, $before, $after) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $`, $');
|
||||
}
|
||||
$arguments =~ s/\$1/$a/g;
|
||||
$arguments =~ s/\$2/$b/g;
|
||||
$arguments =~ s/\$3/$c/g;
|
||||
|
@ -13,8 +13,8 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 543,
|
||||
BUILD_DATE => "2014-04-07",
|
||||
BUILD_REVISION => 544,
|
||||
BUILD_DATE => "2014-04-19",
|
||||
};
|
||||
|
||||
1;
|
||||
|
1404
data/factoids
1404
data/factoids
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user