Branch Coverage

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


line true false branch
257 0 0 if ($ENV{'MOD_PERL'})
258 0 0 if ($] < 5.006)
267 0 1 if $@
274 0 0 unless my $host = $ENV{'REMOTE_ADDR'}
277 0 0 if ($ENV{'REQUEST_METHOD'} eq 'POST') { }
280 0 0 if (formcheck($in, $args->{'subject'}, $error) == 0)
284 0 0 if $@
325 0 0 if (@_ % 2)
331 0 0 unless $args{$_}
334 0 0 unless defined $defaults{$_}
336 0 0 if ($args{'recmail'} and emailsyntax($args{'recmail'}))
339 0 0 $args{'tempdir'} ? :
340 0 0 unless (-d $CGITempFile::TMPDIRECTORY and -w _ and -x _)
347 0 0 if ($args{$_} and not -f $args{$_})
354 0 0 if ($@)
361 0 0 if $error
378 0 0 if ($ENV{'CONTENT_LENGTH'} > 1024 * $max)
398 0 0 unless $in->{$_}
399 0 0 unless $in->{'subject'} or $defaultsubject
400 0 0 if emailsyntax($in->{'email'})
401 0 0 %$error ? :
405 0 0 unless my($localpart, $domain) = (shift()) =~ /^(.+)@(.+)/
409 0 0 unless $localpart =~ /^$word(?:\.$word)*$/
410 0 0 $domain =~ /^$atom(?:\.$atom)+$/ ? :
418 0 0 if (my $agent = $ENV{'HTTP_USER_AGENT'})
425 0 0 if $ENV{'HTTP_REFERER'}
430 0 0 $@ ? :
431 0 0 if $convert
433 0 0 if $convert
448 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'}})
454 0 0 $args->{'nocopy'} ? :
456 0 0 if ($args->{'resulttmplpath'}) { }
480 0 0 %$error ? :
487 0 0 $in->{$_} ? :
493 0 0 $ENV{'HTTP_USER_AGENT'} && $ENV{'HTTP_USER_AGENT'} =~ m[Mozilla/[34]] && !($ENV{'HTTP_USER_AGENT'} =~ /MSIE|Opera/) ? :
495 0 0 if ($args->{'formtmplpath'}) { }
573 0 0 unless open FH, "< $template"
579 0 0 if ($tmpl_vars{lc $+}) { }
585 0 0 if $error
592 0 0 if ($name =~ /[[:^ascii:]]/)
595 0 0 if ($name =~ /[^ \w]/)
604 0 0 unless $str =~ /[[:^ascii:]]/
624 0 0 if $line =~ /^ *$/
630 0 0 if ($text =~ /^ / or $text =~ /^>/ or $text =~ /^From / or $num_quotes > 0)
651 0 0 if (not $args->{'fixed'} or $args->{'fixed'} == 1 and $num_quotes)
664 0 0 if $args->{'quote'}
666 0 0 if (not defined $line && length $line) { }
0 0 elsif (length($line) + $num_quotes <= $args->{'max_length'} - 1) { }
682 0 0 if (length $line <= $args->{'opt_length'}) { }
0 0 elsif ($line =~ /^(.{$min,$opt1}) (.*)/ or $line =~ /^(.{$min,$max1}) (.*)/ or $line =~ /^(.{$min,}) (.*)/) { }
709 0 0 unless ($ENV{'HTTP_COOKIE'} and ($cookie) = $ENV{'HTTP_COOKIE'} =~ /\bContactForm_time=(\d+)/)
713 0 0 unless open FH, 'File::Spec'->catfile($tempdir, 'ContactForm_time')
716 0 0 unless close FH
717 0 0 if ($cookie + 7200 < $time or not grep(($cookie eq $_), @timestamps))
728 0 0 unless sysopen FH, 'File::Spec'->catfile($tempdir, 'ContactForm_time'), 66
730 0 0 unless flock FH, 2
732 0 0 unless sysseek FH, 0, 0
733 0 0 if (@timestamps == 2 and $time > $timestamps[0] + 3600 or @timestamps == 1) { }
0 0 elsif (@timestamps == 0) { }
734 0 0 unless truncate FH, 0
738 0 0 unless truncate FH, 0
744 0 0 unless close FH
749 0 0 if ($filter and $msg =~ /$filter/)
761 0 0 unless sysopen FH, 'File::Spec'->catfile($tempdir, 'ContactForm_sent'), 66
763 0 0 unless flock FH, 2
766 0 0 if $timestamp < $time - 3600
772 0 0 unless seek FH, 0, 0
773 0 0 unless truncate FH, 0
775 0 0 unless close FH
777 0 0 if ($senders{$host} > $args->{'maxperhour'})