mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-22 18:52:40 +01:00
Replaced regex gibberish with quotemeta
This commit is contained in:
parent
0275e90dc8
commit
b3b3c04f73
@ -10,21 +10,8 @@ if ($#ARGV < 0) {
|
|||||||
|
|
||||||
my $command = join(' ', @ARGV);
|
my $command = join(' ', @ARGV);
|
||||||
|
|
||||||
$command =~ s/-[^ ]+//g;
|
$command = quotemeta($command);
|
||||||
$command =~ s/\\//g;
|
$command =~ s/\\ / /g;
|
||||||
$command =~ s/;/\\;/g;
|
|
||||||
$command =~ s/\(/\\(/g;
|
|
||||||
$command =~ s/\)/\\)/g;
|
|
||||||
$command =~ s/\$/\\\$/g;
|
|
||||||
$command =~ s/\[/\\[/g;
|
|
||||||
$command =~ s/\]/\\]/g;
|
|
||||||
$command =~ s/\|/\\|/g;
|
|
||||||
$command =~ s/'/\\'/g;
|
|
||||||
$command =~ s/`/\\`/g;
|
|
||||||
$command =~ s/,/\\,/g;
|
|
||||||
$command =~ s/\*/\\*/g;
|
|
||||||
$command =~ s/\?/\\?/g;
|
|
||||||
|
|
||||||
#print "[$command]\n";
|
#print "[$command]\n";
|
||||||
my $result = `/usr/bin/cdecl -c $command`;
|
my $result = `/usr/bin/cdecl -c $command`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user