mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-10 20:12:35 +01:00
Fix /say substitution derp that allowed "/say /msg foo bar" to actually invoke /msg rather than saying "/msg foo bar"
This commit is contained in:
parent
02ebf106a8
commit
c91a8e5c3d
@ -478,11 +478,15 @@ sub interpreter {
|
|||||||
|
|
||||||
$result =~ s/\\\$/\$/g;
|
$result =~ s/\\\$/\$/g;
|
||||||
|
|
||||||
if($result =~ s/^\/say\s+/$ref_from/i || $result =~ s/^\/me\s+(.*)/\/me $1 $ref_from/i
|
if($ref_from) {
|
||||||
|| $result =~ s/^\/msg\s+([^ ]+)/\/msg $1 $ref_from/i) {
|
if($result =~ s/^\/say\s+/$ref_from/i || $result =~ s/^\/me\s+(.*)/\/me $1 $ref_from/i
|
||||||
|
|| $result =~ s/^\/msg\s+([^ ]+)/\/msg $1 $ref_from/i) {
|
||||||
|
return $result;
|
||||||
|
} else {
|
||||||
|
return $ref_from . "$keyword is $result";
|
||||||
|
}
|
||||||
|
}else {
|
||||||
return $result;
|
return $result;
|
||||||
} else {
|
|
||||||
return $ref_from . "$keyword is $result";
|
|
||||||
}
|
}
|
||||||
} elsif($self->factoids->hash->{$channel}->{$keyword}->{type} eq 'regex') {
|
} elsif($self->factoids->hash->{$channel}->{$keyword}->{type} eq 'regex') {
|
||||||
$result = eval {
|
$result = eval {
|
||||||
|
@ -168,11 +168,16 @@ sub process_line {
|
|||||||
|
|
||||||
$pbot->logger->log("Final result: $result\n");
|
$pbot->logger->log("Final result: $result\n");
|
||||||
|
|
||||||
if($result =~ s/^\/me\s+//i) {
|
if($result =~ s/^\/say\s+//i) {
|
||||||
|
$pbot->conn->privmsg($from, $result) if defined $from && $from !~ /\Q$mynick\E/i;
|
||||||
|
} elsif($result =~ s/^\/me\s+//i) {
|
||||||
$pbot->conn->me($from, $result) if defined $from && $from !~ /\Q$mynick\E/i;
|
$pbot->conn->me($from, $result) if defined $from && $from !~ /\Q$mynick\E/i;
|
||||||
} elsif($result =~ s/^\/msg\s+([^\s]+)\s+//i) {
|
} elsif($result =~ s/^\/msg\s+([^\s]+)\s+//i) {
|
||||||
my $to = $1;
|
my $to = $1;
|
||||||
if($to =~ /.*serv$/i) {
|
if($to =~ /,/) {
|
||||||
|
$pbot->logger->log("[HACK] Possible HACK ATTEMPT /msg multiple users: [$nick!$user\@$host] [$command] [$result]\n");
|
||||||
|
}
|
||||||
|
elsif($to =~ /.*serv$/i) {
|
||||||
$pbot->logger->log("[HACK] Possible HACK ATTEMPT /msg *serv: [$nick!$user\@$host] [$command] [$result]\n");
|
$pbot->logger->log("[HACK] Possible HACK ATTEMPT /msg *serv: [$nick!$user\@$host] [$command] [$result]\n");
|
||||||
}
|
}
|
||||||
elsif($result =~ s/^\/me\s+//i) {
|
elsif($result =~ s/^\/me\s+//i) {
|
||||||
|
@ -13,7 +13,7 @@ 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 => 445,
|
BUILD_REVISION => 446,
|
||||||
BUILD_DATE => "2013-10-12",
|
BUILD_DATE => "2013-10-12",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user