Fix warnings
authorJamie Cameron <jcameron@webmin.com>
Tue, 16 Aug 2011 17:23:45 +0000 (10:23 -0700)
committerJamie Cameron <jcameron@webmin.com>
Tue, 16 Aug 2011 17:23:45 +0000 (10:23 -0700)
https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3392381&group_id=17457

backup-config/backup-config-lib.pl
backup-config/index.cgi

index 17814a0..f1bffa4 100755 (executable)
@@ -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 {
index bc6a4d1..68e5004 100755 (executable)
@@ -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 ],