Commit 505d8d88 authored by Alex Xu's avatar Alex Xu Committed by Sébastien Helleu

launcher.pl 0.6: fix escaping of "signal_data"

parent bde6ef63
......@@ -22,6 +22,8 @@
#
# History:
#
# 2017-08-29, Alex Xu (Hello71) <alex_y_xu@yahoo.ca>:
# version 0.6: fix escaping of "signal_data"
# 2011-02-13, Sebastien Helleu <flashcode@flashtux.org>:
# version 0.5: use new help format for command arguments
# 2010-05-29, Sebastien Helleu <flashcode@flashtux.org>:
......@@ -36,7 +38,7 @@
use strict;
my $version = "0.5";
my $version = "0.6";
my $command_suffix = " &";
weechat::register("launcher", "FlashCode <flashcode\@flashtux.org>", $version, "GPL3",
......@@ -109,9 +111,8 @@ sub signal
my $command = weechat::config_get_plugin("signal.$_[1]");
if ($command ne "")
{
$signal_data =~ s/([\$`"])/\\$1/g;
$signal_data =~ s/\n/ /g;
$command =~ s/\$signal_data/"$signal_data"/g;
$signal_data =~ s/'/'\''/g;
$command =~ s/\$signal_data/'$signal_data'/g;
system($command.$command_suffix);
}
return weechat::WEECHAT_RC_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment