From fa39bc3a92fd2a8b7efdcbb7ae326e3227a9e4f3 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Mon, 25 Apr 2016 19:51:28 -0700 Subject: Quote message before passing to shell --- scripts/hilightcmd.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') 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 )); } }); -- cgit v1.2.3