From d76340fd44ec77317af1261a468a630f53da5007 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Wed, 1 Aug 2012 16:30:45 +0200 Subject: [PATCH] Bug 8268: improve error checking Valid download attempts were being denied thanks to an incorrect regular expression. This patch fixes that, and makes it easier to understand what's going on in the code. Signed-off-by: Jonathan Druart --- tools/export.pl | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/export.pl b/tools/export.pl index d3ad16f..9259c50 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -345,7 +345,8 @@ sub download_backup { my $filename = $args->{filename}; return unless ( $directory && -d $directory ); - return unless ( $filename =~ m/$extension(\.(gz|bz2|xz))?$/ && not $filename =~ m#|# ); + return unless ( $filename =~ m/\.$extension(\.(gz|bz2|xz))?$/ ); + return if ( $filename =~ m#/# ); $filename = "$directory/$filename"; return unless ( -f $filename && -r $filename ); return unless ( open(my $dump, '<', $filename) ); -- 1.7.7.3