From 421ee7be689bbf3527dcf6166cb56eb9c1691bac Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 16 Aug 2011 10:23:45 -0700 Subject: [PATCH] Fix warnings https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3392381&group_id=17457 --- backup-config/backup-config-lib.pl | 9 +++++---- backup-config/index.cgi | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backup-config/backup-config-lib.pl b/backup-config/backup-config-lib.pl index 17814a058..f1bffa4fa 100755 --- a/backup-config/backup-config-lib.pl +++ b/backup-config/backup-config-lib.pl @@ -125,16 +125,17 @@ user, pass, host, page, port (optional) =cut sub parse_backup_url { -if ($_[0] =~ /^ftp:\/\/([^:]*):([^\@]*)\@([^\/:]+)(:(\d+))?(\/.*)$/) { +if ($_[0] && $_[0] =~ /^ftp:\/\/([^:]*):([^\@]*)\@([^\/:]+)(:(\d+))?(\/.*)$/) { return (1, $1, $2, $3, $6, $5); } -elsif ($_[0] =~ /^ssh:\/\/([^:]*):([^\@]*)\@([^\/:]+)(:(\d+))?(\/.*)$/) { +elsif ($_[0] && + $_[0] =~ /^ssh:\/\/([^:]*):([^\@]*)\@([^\/:]+)(:(\d+))?(\/.*)$/) { return (2, $1, $2, $3, $6, $5); } -elsif ($_[0] =~ /^upload:(.*)$/) { +elsif ($_[0] && $_[0] =~ /^upload:(.*)$/) { return (3, undef, undef, undef, $1); } -elsif ($_[0] =~ /^download:$/) { +elsif ($_[0] && $_[0] =~ /^download:$/) { return (4, undef, undef, undef, undef); } else { diff --git a/backup-config/index.cgi b/backup-config/index.cgi index bc6a4d183..68e5004ff 100755 --- a/backup-config/index.cgi +++ b/backup-config/index.cgi @@ -59,7 +59,7 @@ print &ui_tabs_start_tab("tab", "backup"); print &ui_form_start("backup.cgi/backup.tgz", "post"); print &ui_table_start($text{'index_header'}, undef, 2); -my @dmods = split(/\s+/, $config{'mods'}); +my @dmods = split(/\s+/, $config{'mods'} || ""); print &ui_table_row($text{'edit_mods'}, &ui_select("mods", \@dmods, [ map { [ $_->{'dir'}, $_->{'desc'} ] } @mods ],