Branch Coverage

blib/lib/CGI/ContactForm.pm
Criterion Covered Total %
branch 1 146 0.6


line true false branch
259 0 0 if ($ENV{'MOD_PERL'})
260 0 0 if ($] < 5.006)
269 0 1 if $@
276 0 0 unless my $host = $ENV{'REMOTE_ADDR'}
279 0 0 if ($ENV{'REQUEST_METHOD'} eq 'POST') { }
282 0 0 if (formcheck($in, $args->{'subject'}, $error) == 0)
286 0 0 if $@
327 0 0 if (@_ % 2)
333 0 0 unless $args{$_}
336 0 0 unless defined $defaults{$_}
338 0 0 if ($args{'recmail'} and emailsyntax($args{'recmail'}))
341 0 0 $args{'tempdir'} ? :
342 0 0 unless (-d $CGITempFile::TMPDIRECTORY and -w _ and -x _)
349 0 0 if ($args{$_} and not -f $args{$_})
356 0 0 if ($@)
363 0 0 if $error
380 0 0 if ($ENV{'CONTENT_LENGTH'} > 1024 * $max)
400 0 0 unless $in->{$_}
401 0 0 unless $in->{'subject'} or $defaultsubject
402 0 0 if emailsyntax($in->{'email'})
403 0 0 %$error ? :
407 0 0 unless my($localpart, $domain) = (shift()) =~ /^(.+)@(.+)/
411 0 0 unless $localpart =~ /^$word(?:\.$word)*$/
412 0 0 $domain =~ /^$atom(?:\.$atom)+$/ ? :
420 0 0 if (my $agent = $ENV{'HTTP_USER_AGENT'})
427 0 0 if $ENV{'HTTP_REFERER'}
432 0 0 $@ ? :
433 0 0 if $convert
435 0 0 if $convert
450 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'}})
456 0 0 $args->{'nocopy'} ? :
458 0 0 if ($args->{'resulttmplpath'}) { }
482 0 0 %$error ? :
489 0 0 $in->{$_} ? :
495 0 0 $ENV{'HTTP_USER_AGENT'} && $ENV{'HTTP_USER_AGENT'} =~ m[Mozilla/[34]] && !($ENV{'HTTP_USER_AGENT'} =~ /MSIE|Opera/) ? :
497 0 0 if ($args->{'formtmplpath'}) { }
575 0 0 unless open FH, "< $template"
581 0 0 if ($tmpl_vars{lc $+}) { }
587 0 0 if $error
594 0 0 if ($name =~ /[[:^ascii:]]/)
597 0 0 if ($name =~ /[^ \w]/)
606 0 0 unless $str =~ /[[:^ascii:]]/
626 0 0 if $line =~ /^ *$/
632 0 0 if ($text =~ /^ / or $text =~ /^>/ or $text =~ /^From / or $num_quotes > 0)
653 0 0 if (not $args->{'fixed'} or $args->{'fixed'} == 1 and $num_quotes)
666 0 0 if $args->{'quote'}
668 0 0 if (not defined $line && length $line) { }
0 0 elsif (length($line) + $num_quotes <= $args->{'max_length'} - 1) { }
684 0 0 if (length $line <= $args->{'opt_length'}) { }
0 0 elsif ($line =~ /^(.{$min,$opt1}) (.*)/ or $line =~ /^(.{$min,$max1}) (.*)/ or $line =~ /^(.{$min,}) (.*)/) { }
711 0 0 unless ($ENV{'HTTP_COOKIE'} and ($cookie) = $ENV{'HTTP_COOKIE'} =~ /\bContactForm_time=(\d+)/)
715 0 0 unless open FH, 'File::Spec'->catfile($tempdir, 'ContactForm_time')
718 0 0 unless close FH
719 0 0 if ($cookie + 7200 < $time or not grep(($cookie eq $_), @timestamps))
730 0 0 unless sysopen FH, 'File::Spec'->catfile($tempdir, 'ContactForm_time'), 66
732 0 0 unless flock FH, 2
734 0 0 unless sysseek FH, 0, 0
735 0 0 if (@timestamps == 2 and $time > $timestamps[0] + 3600 or @timestamps == 1) { }
0 0 elsif (@timestamps == 0) { }
736 0 0 unless truncate FH, 0
740 0 0 unless truncate FH, 0
746 0 0 unless close FH
751 0 0 if ($filter and $msg =~ /$filter/)
763 0 0 unless sysopen FH, 'File::Spec'->catfile($tempdir, 'ContactForm_sent'), 66
765 0 0 unless flock FH, 2
768 0 0 if $timestamp < $time - 3600
774 0 0 unless seek FH, 0, 0
775 0 0 unless truncate FH, 0
777 0 0 unless close FH
779 0 0 if ($senders{$host} > $args->{'maxperhour'})