diff --git a/applets/random_quote.pl b/applets/random_quote.pl index 50322899..c036e406 100755 --- a/applets/random_quote.pl +++ b/applets/random_quote.pl @@ -6,6 +6,7 @@ # Quick and dirty by :pragma use LWP::UserAgent::WithCache; +use URI::Escape; my ($text, $t); @@ -35,7 +36,7 @@ while (1) { my $author = ""; $arguments =~ s/\$nick/me/gi; - $arguments =~ s/\s/+/g; + $arguments = uri_escape($arguments); if ($arguments =~ m/\-\-author[\s\+]+(.*)/i) { $author = $1; diff --git a/cpanfile b/cpanfile index 2c098b6d..3871c0ba 100644 --- a/cpanfile +++ b/cpanfile @@ -389,6 +389,7 @@ feature qalc => sub { }; feature random_quote => sub { + requires 'URI::Escape'; requires 'LWP::UserAgent::WithCache'; }; diff --git a/lib/PBot/Plugin/FuncSed.pm b/lib/PBot/Plugin/FuncSed.pm index f50527bb..7ddcaec9 100644 --- a/lib/PBot/Plugin/FuncSed.pm +++ b/lib/PBot/Plugin/FuncSed.pm @@ -33,26 +33,35 @@ sub func_sed { my $self = shift; my $text = "@_"; - if ($text =~ /^s(.)(.*?)(?//[Pig]; P preserve case; i ignore case; g replace all'; } - return $a; - } else { - return "sed: syntax error"; + }; + + if (my $e = $@) { + $e =~ s/ at .*$//; + return "sed: syntax error: $e"; } + + return $result; } use warnings; diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index a43cd5e0..8f29bd5d 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,8 +25,8 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4560, - BUILD_DATE => "2022-07-14", + BUILD_REVISION => 4561, + BUILD_DATE => "2022-08-03", }; sub initialize {}