- From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 12 Jun 2008 22:24:03 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/perl/modules/W3C/XHTML/HTMLCompatChecker/bin In directory hutz:/tmp/cvs-serv20816/bin Modified Files: appCcheck.pl Log Message: small fix - for cases where no URI given Index: appCcheck.pl =================================================================== RCS file: /sources/public/perl/modules/W3C/XHTML/HTMLCompatChecker/bin/appCcheck.pl,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- appCcheck.pl 12 Jun 2008 22:13:54 -0000 1.41 +++ appCcheck.pl 12 Jun 2008 22:24:00 -0000 1.42 @@ -193,36 +193,39 @@ $output->param(info_count => 0); $output->param(warning_count => 0); $output->param(error_count => 0); +$output->param(Abort=>0); + my $compat_parser = W3C::XHTML::HTMLCompatChecker->new(); -my @checker_messages = $compat_parser->check_uri($uri); -if (exists $checker_messages[0]) { - if ($checker_messages[0]{"severity"} eq "Abort"){ - if ($checker_messages[0]{"message_text"} != "Bad URI") { $output->param(uri => $uri);} - $output->param(Abort=>1); - $output->param(Abort_Message=>$checker_messages[0]{"message_text"}); - } - else { - $output->param(uri => $uri); - $output->param(message_loop => \@checker_messages); - my (@ERRORS, @WARNINGS, @INFOS); - for (my $i=0; $i < scalar @checker_messages; $i++) - { - if ($checker_messages[$i]{'severity'} eq "Error") { push @ERRORS, $checker_messages[$i];} - elsif ($checker_messages[$i]{'severity'} eq "Warning") {push @WARNINGS, $checker_messages[$i];} - else {push @INFOS, $checker_messages[$i];} +if ($uri){ + my @checker_messages = $compat_parser->check_uri($uri); + if (exists $checker_messages[0]) { + if ($checker_messages[0]{"severity"} eq "Abort"){ + if ($checker_messages[0]{"message_text"} ne "Bad URI") { $output->param(uri => $uri);} + $output->param(Abort=>1); + $output->param(Abort_Message=>$checker_messages[0]{"message_text"}); } - if (@ERRORS) {$output->param(passed => 0) } else {$output->param(passed => 1)} - $output->param(info_loop => \@INFOS); - $output->param(info_count => scalar @INFOS); - $output->param(warning_loop => \@WARNINGS); - $output->param(warning_count => scalar @WARNINGS); - $output->param(error_loop => \@ERRORS); - $output->param(error_count => scalar @ERRORS); + else { + $output->param(uri => $uri); + $output->param(message_loop => \@checker_messages); + my (@ERRORS, @WARNINGS, @INFOS); + for (my $i=0; $i < scalar @checker_messages; $i++) + { + if ($checker_messages[$i]{'severity'} eq "Error") { push @ERRORS, $checker_messages[$i];} + elsif ($checker_messages[$i]{'severity'} eq "Warning") {push @WARNINGS, $checker_messages[$i];} + else {push @INFOS, $checker_messages[$i];} + } + if (@ERRORS) {$output->param(passed => 0) } else {$output->param(passed => 1)} + $output->param(info_loop => \@INFOS); + $output->param(info_count => scalar @INFOS); + $output->param(warning_loop => \@WARNINGS); + $output->param(warning_count => scalar @WARNINGS); + $output->param(error_loop => \@ERRORS); + $output->param(error_count => scalar @ERRORS); - } -} else {$output->param(uri => $uri);} - + } + } else {$output->param(uri => $uri);} +} print $output->output();
Received on Thursday, 12 June 2008 22:24:36 UTC