Branch Coverage

blib/lib/CGI/ContactForm.pm
Criterion Covered Total %
branch 2 148 1.3


line true false branch
256 0 0 if ($ENV{'MOD_PERL'})
257 0 0 if ($] < 5.006)
266 0 1 if $@
268 0 1 if $@
275 0 0 unless my $host = $ENV{'REMOTE_ADDR'}
278 0 0 if ($ENV{'REQUEST_METHOD'} eq 'POST') { }
281 0 0 if (formcheck($in, $args->{'subject'}, $error) == 0)
285 0 0 if $@
326 0 0 if (@_ % 2)
332 0 0 unless $args{$_}
335 0 0 unless defined $defaults{$_}
337 0 0 if ($args{'recmail'} and emailsyntax($args{'recmail'}))
340 0 0 $args{'tempdir'} ? :
341 0 0 unless (-d $CGITempFile::TMPDIRECTORY and -w _ and -x _)
348 0 0 if ($args{$_} and not -f $args{$_})
355 0 0 if ($@)
362 0 0 if $error
379 0 0 if ($ENV{'CONTENT_LENGTH'} > 1024 * $max)
399 0 0 unless $in->{$_}
400 0 0 unless $in->{'subject'} or $defaultsubject
401 0 0 if emailsyntax($in->{'email'})
402 0 0 %$error ? :
406 0 0 unless my($localpart, $domain) = (shift()) =~ /^(.+)@(.+)/
410 0 0 unless $localpart =~ /^$word(?:\.$word)*$/
411 0 0 $domain =~ /^$atom(?:\.$atom)+$/ ? :
419 0 0 if (my $agent = $ENV{'HTTP_USER_AGENT'})
426 0 0 if $ENV{'HTTP_REFERER'}
431 0 0 $@ ? :
432 0 0 if $convert
434 0 0 if $convert
449 0 0 $in->{'message'} =~ /[[:^ascii:]]/ ? :
0 0 $args->{'bouncetosender'} ? :
0 0 $args->{'nocopy'} ? :
0 0 unless ref 'Mail::Sender'->new->MailMsg({'smtp', $args->{'smtp'}, 'encoding', $in->{'message'} =~ /[[:^ascii:]]/ ? 'quoted-printable' : '7bit', 'from', $args->{'bouncetosender'} ? $in->{'email'} : $args->{'recmail'}, 'fake_from', namefix($in->{'name'}, $args->{'encoding'}) . " <$in->{'email'}>", 'to', namefix($args->{'recname'}, $args->{'encoding'}) . " <$args->{'recmail'}>", 'bcc', $args->{'nocopy'} ? '' : $in->{'email'}, 'subject', mimeencode($in->{'subject'}, $args->{'encoding'}), 'msg', $in->{'message'}})
455 0 0 $args->{'nocopy'} ? :
457 0 0 if ($args->{'resulttmplpath'}) { }
481 0 0 %$error ? :
488 0 0 $in->{$_} ? :
494 0 0 $ENV{'HTTP_USER_AGENT'} && $ENV{'HTTP_USER_AGENT'} =~ m[Mozilla/[34]] && !($ENV{'HTTP_USER_AGENT'} =~ /MSIE|Opera/) ? :
496 0 0 if ($args->{'formtmplpath'}) { }
574 0 0 unless open FH, "< $template"
580 0 0 if ($tmpl_vars{lc $+}) { }
586 0 0 if $error
593 0 0 if ($name =~ /[[:^ascii:]]/)
596 0 0 if ($name =~ /[^ \w]/)
605 0 0 unless $str =~ /[[:^ascii:]]/
625 0 0 if $line =~ /^ *$/
631 0 0 if ($text =~ /^ / or $text =~ /^>/ or $text =~ /^From / or $num_quotes > 0)
652 0 0 if (not $args->{'fixed'} or $args->{'fixed'} == 1 and $num_quotes)
665 0 0 if $args->{'quote'}
667 0 0 if (not defined $line && length $line) { }
0 0 elsif (length($line) + $num_quotes <= $args->{'max_length'} - 1) { }
683 0 0 if (length $line <= $args->{'opt_length'}) { }
0 0 elsif ($line =~ /^(.{$min,$opt1}) (.*)/ or $line =~ /^(.{$min,$max1}) (.*)/ or $line =~ /^(.{$min,}) (.*)/) { }
710 0 0 unless ($ENV{'HTTP_COOKIE'} and ($cookie) = $ENV{'HTTP_COOKIE'} =~ /\bContactForm_time=(\d+)/)
714 0 0 unless open FH, 'File::Spec'->catfile($tempdir, 'ContactForm_time')
717 0 0 unless close FH
718 0 0 if ($cookie + 7200 < $time or not grep(($cookie eq $_), @timestamps))
729 0 0 unless sysopen FH, 'File::Spec'->catfile($tempdir, 'ContactForm_time'), 66
731 0 0 unless flock FH, 2
733 0 0 unless sysseek FH, 0, 0
734 0 0 if (@timestamps == 2 and $time > $timestamps[0] + 3600 or @timestamps == 1) { }
0 0 elsif (@timestamps == 0) { }
735 0 0 unless truncate FH, 0
739 0 0 unless truncate FH, 0
745 0 0 unless close FH
750 0 0 if ($filter and $msg =~ /$filter/)
762 0 0 unless sysopen FH, 'File::Spec'->catfile($tempdir, 'ContactForm_sent'), 66
764 0 0 unless flock FH, 2
767 0 0 if $timestamp < $time - 3600
773 0 0 unless seek FH, 0, 0
774 0 0 unless truncate FH, 0
776 0 0 unless close FH
778 0 0 if ($senders{$host} > $args->{'maxperhour'})