From: Trevor Slocum Date: Tue, 26 Apr 2016 02:51:28 +0000 (-0700) Subject: Quote message before passing to shell X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=fa39bc3a92fd2a8b7efdcbb7ae326e3227a9e4f3;p=irssi-scripts.irssi.org.git Quote message before passing to shell --- diff --git a/scripts/hilightcmd.pl b/scripts/hilightcmd.pl index a234082..c2c8295 100644 --- a/scripts/hilightcmd.pl +++ b/scripts/hilightcmd.pl @@ -12,6 +12,7 @@ use Irssi; use POSIX; use vars qw($VERSION %IRSSI); use Text::Sprintf::Named qw(named_sprintf); +use String::ShellQuote qw(shell_quote_best_effort); $VERSION = "0.1"; %IRSSI = (authors => "Guillaume Gelin", @@ -38,7 +39,7 @@ Irssi::signal_add('print text' => sub { $stripped =~ s/"/\\"/g; system(named_sprintf( Irssi::settings_get_str('hilightcmd_systemcmd'), - message => $stripped + message => shell_quote_best_effort $stripped )); } });