From: Arne Fitzenreiter Date: Tue, 6 Oct 2009 19:09:52 +0000 (+0200) Subject: Change that iptv-mac field could also empty for save X-Git-Tag: v2.9-beta1~709 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=19b01b74f9b9e7cb01943f6c118b45d1eced9b4c Change that iptv-mac field could also empty for save --- diff --git a/html/cgi-bin/backup.cgi b/html/cgi-bin/backup.cgi old mode 100755 new mode 100644 diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi old mode 100755 new mode 100644 diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi old mode 100755 new mode 100644 diff --git a/html/cgi-bin/mac.cgi b/html/cgi-bin/mac.cgi index 7c00cc3342..83207d6629 100644 --- a/html/cgi-bin/mac.cgi +++ b/html/cgi-bin/mac.cgi @@ -22,8 +22,8 @@ use strict; # enable only the following on debugging purpose -use warnings; -use CGI::Carp 'fatalsToBrowser'; +#use warnings; +#use CGI::Carp 'fatalsToBrowser'; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; @@ -56,16 +56,19 @@ if ($macsettings{'ACTION'} eq $Lang::tr{'save'}) { $errormessage = $Lang::tr{'mac address error not valid'}; } $macsettings{'MAC2'} =~ s/\-/:/g; - my @mac = split(/:/,$macsettings{"MAC2"}); - if ($#mac == 5) { - foreach (@mac) { - unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) { - $errormessage = $Lang::tr{'mac address error not valid'}; - last; + + if ( not ($macsettings{'MAC2'} eq "" )) { + my @mac = split(/:/,$macsettings{"MAC2"}); + if ($#mac == 5) { + foreach (@mac) { + unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) { + $errormessage = $Lang::tr{'mac address error not valid'}; + last; + } } + } else { + $errormessage = $Lang::tr{'mac address error not valid'}; } - } else { - $errormessage = $Lang::tr{'mac address error not valid'}; } if ($errormessage eq "") { $macsettings{'MAC'} =~ s/\:/-/g; diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi old mode 100755 new mode 100644