From 08bd83cf508b20f915c3b204f2a7b750bc4b67b9 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 12 Dec 2011 23:48:06 +0100 Subject: [PATCH] more strictly parse login and path --- gearman/send_file.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gearman/send_file.pl b/gearman/send_file.pl index c828de8..1c093d1 100755 --- a/gearman/send_file.pl +++ b/gearman/send_file.pl @@ -25,8 +25,8 @@ $worker->register_function( send_file => sub { my ( $from, $to ) = split(/#/,$work,2); - my $f_uid = $1 if $from =~ s/~(\w+)//; - my $t_uid = $1 if $to =~ s/~(\w+)//; + my $f_uid = $1 if $from =~ s{~(\w+)/}{}; + my $t_uid = $1 if $to =~ s{~(\w+)/}{}; warn "send_file $f_uid $from -> $t_uid $to\n"; @@ -41,7 +41,7 @@ $worker->register_function( rename_file => sub { warn "# rename_file [$work]\n"; my ( $from, $to ) = split(/#/,$work,2); - my $login = $1 if $from =~ s/~(\w+)//; + my $login = $1 if $from =~ s{~(\w+)/}{}; $api->rename_file( $login, $from, $to ); }); @@ -51,7 +51,7 @@ $worker->register_function( delete => sub { chomp $work; warn "# delete [$work]\n"; - my $login = $1 if $work =~ s/~(\w+)//; + my $login = $1 if $work =~ s{~(\w+)}{}; $api->delete( $login, $work ); }); -- 2.20.1