blib/lib/CGI/Info.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
condition | 116 | 173 | 67.0 |
line | !l | l&&!r | l&&r | condition |
---|---|---|---|---|
83 | 152 | 1 | 1 | $args{'expect'} and ref $args{'expect'} ne "ARRAY" |
148 | 4 | 10 | 0 | $ENV{'SCRIPT_NAME'} and $ENV{'DOCUMENT_ROOT'} |
4 | 0 | 5 | $ENV{'SCRIPT_NAME'} and not $ENV{'DOCUMENT_ROOT'} | |
158 | 2 | 2 | 1 | "File::Spec"->file_name_is_absolute($ENV{'SCRIPT_NAME'}) and -r $ENV{'SCRIPT_NAME'} |
284 | 5 | 0 | 2 | $self->{'site'} and $self->{'cgi_site'} |
300 | 0 | 2 | 1 | defined $self->protocol and $self->protocol ne "http" |
329 | 0 | 0 | 5 | $self->{'site'} and $self->{'cgi_site'} |
483 | 68 | 94 | 0 | defined $self->{'paramref'} and !defined($args{'allow'}) || defined $self->{'allow'} && $args{'allow'} eq $self->{'allow'} |
511 | 6 | 0 | 63 | $ENV{'GATEWAY_INTERFACE'} && $ENV{'REQUEST_METHOD'} |
551 | 40 | 0 | 1 | defined $content_type and $content_type =~ m[multipart/form-data]i |
565 | 0 | 14 | 0 | $self->{'max_upload_size'} >= 0 and $content_length > $self->{'max_upload_size'} |
740 | 75 | 3 | 2 | $self->{'expect'} and &List::MoreUtils::none(sub { $_ eq $key; } , @{$$self{"expect"};}) |
782 | 65 | 1 | 5 | $FORM{$key} and $FORM{$key} ne $value |
838 | 17 | 4 | 4 | $self->{'allow'} and not exists $self->{'allow'}{$field} |
1065 | 4 | 9 | 0 | defined $remote and $self->{'cache'} |
1081 | 11 | 0 | 2 | defined $device && $device =~ /blackberry|webos|iphone|ipod|ipad|android/i |
1082 | 13 | 0 | 0 | $self->{'cache'} and defined $remote |
1106 | 1 | 3 | 1 | $ENV{'HTTP_USER_AGENT'} and $ENV{'HTTP_USER_AGENT'} =~ /.+(iPad|TabletPC).+/ |
1144 | 0 | 27 | 1 | $rc and $self->{'logger'} |
1161 | 18 | 1 | 2 | $ENV{'SCRIPT_URI'} and $ENV{'SCRIPT_URI'} =~ m[^(.+)://.+] |
1164 | 16 | 1 | 2 | $ENV{'SERVER_PROTOCOL'} and $ENV{'SERVER_PROTOCOL'} =~ m[^HTTP/] |
1234 | 5 | 6 | 4 | $ENV{'C_DOCUMENT_ROOT'} and -d $ENV{'C_DOCUMENT_ROOT'} |
1236 | 2 | 0 | 2 | -d $dir and -w $dir |
1240 | 0 | 0 | 2 | -d $dir and -w $dir |
1244 | 5 | 5 | 1 | $ENV{'DOCUMENT_ROOT'} and -d $ENV{'DOCUMENT_ROOT'} |
1246 | 0 | 0 | 1 | -d $dir and -w $dir |
1268 | 8 | 1 | 0 | $ENV{'C_DOCUMENT_ROOT'} and -d $ENV{'C_DOCUMENT_ROOT'} |
4 | 2 | 3 | $ENV{'DOCUMENT_ROOT'} and -d $ENV{'DOCUMENT_ROOT'} | |
1315 | 4 | 0 | 5 | defined $rc and length $rc |
4 | 2 | 3 | defined $rc and length $rc and -d $rc | |
2 | 0 | 3 | defined $rc and length $rc and -d $rc and -w $rc | |
1349 | 6 | 1 | 9 | $remote and $agent |
1428 | 2 | 1 | 1 | defined $is_robot and $self->{'logger'} |
1431 | 2 | 0 | 2 | defined $is_robot && $is_robot |
1476 | 7 | 1 | 11 | $remote and $agent |
1510 | 5 | 5 | 1 | not $is_search and $agent =~ m[SeznamBot/] |
1523 | 0 | 0 | 0 | defined $hostname and $hostname =~ /google|msnbot|bingbot|amazonbot/ |
0 | 0 | 0 | defined $hostname and $hostname =~ /google|msnbot|bingbot|amazonbot/ and not $hostname =~ /^google-proxy/ | |
1681 | 2 | 0 | 1 | $method eq "POST" and not defined $ENV{'CONTENT_LENGTH'} |
line | l | !l | condition |
---|---|---|---|
1690 | 7 | 0 | $self->{'status'} || 200 |
line | l | !l&&r | !l&&!r | condition |
---|---|---|---|---|
483 | 93 | 0 | 1 | !defined($args{'allow'}) || defined $self->{'allow'} && $args{'allow'} eq $self->{'allow'} |
511 | 43 | 1 | 19 | $ENV{'REQUEST_METHOD'} eq "GET" or $ENV{'REQUEST_METHOD'} eq "HEAD" |
573 | 3 | 0 | 11 | not defined $content_type or $content_type =~ m[application/x-www-form-urlencoded] |
745 | 11 | 56 | 11 | not defined $ENV{'REQUEST_METHOD'} or $ENV{'REQUEST_METHOD'} eq "GET" |
747 | 3 | 0 | 64 | $value =~ /(\%27)|(\')|(\-\-)|(\%23)|(\#)/xi or $value =~ /((\%3D)|(=))[^\n]*((\%27)|(\')|(\-\-)|(\%3B)|(;))/i |
3 | 0 | 64 | $value =~ /(\%27)|(\')|(\-\-)|(\%23)|(\#)/xi or $value =~ /((\%3D)|(=))[^\n]*((\%27)|(\')|(\-\-)|(\%3B)|(;))/i or $value =~ /\w*((\%27)|(\'))((\%6F)|o|(\%4F))((\%72)|r|(\%52))/xi | |
0 | 0 | 64 | $value =~ /(\%27)|(\')|(\-\-)|(\%23)|(\#)/xi or $value =~ /((\%3D)|(=))[^\n]*((\%27)|(\')|(\-\-)|(\%3B)|(;))/i or $value =~ /\w*((\%27)|(\'))((\%6F)|o|(\%4F))((\%72)|r|(\%52))/xi or $value =~ /((\%27)|(\'))union/xi | |
0 | 0 | 64 | $value =~ /(\%27)|(\')|(\-\-)|(\%23)|(\#)/xi or $value =~ /((\%3D)|(=))[^\n]*((\%27)|(\')|(\-\-)|(\%3B)|(;))/i or $value =~ /\w*((\%27)|(\'))((\%6F)|o|(\%4F))((\%72)|r|(\%52))/xi or $value =~ /((\%27)|(\'))union/xi or $value =~ /select[[a-z]\s\*]from/xi | |
0 | 0 | 64 | $value =~ /(\%27)|(\')|(\-\-)|(\%23)|(\#)/xi or $value =~ /((\%3D)|(=))[^\n]*((\%27)|(\')|(\-\-)|(\%3B)|(;))/i or $value =~ /\w*((\%27)|(\'))((\%6F)|o|(\%4F))((\%72)|r|(\%52))/xi or $value =~ /((\%27)|(\'))union/xi or $value =~ /select[[a-z]\s\*]from/xi or $value =~ /\sAND\s1=1/xi | |
0 | 0 | 64 | $value =~ /(\%27)|(\')|(\-\-)|(\%23)|(\#)/xi or $value =~ /((\%3D)|(=))[^\n]*((\%27)|(\')|(\-\-)|(\%3B)|(;))/i or $value =~ /\w*((\%27)|(\'))((\%6F)|o|(\%4F))((\%72)|r|(\%52))/xi or $value =~ /((\%27)|(\'))union/xi or $value =~ /select[[a-z]\s\*]from/xi or $value =~ /\sAND\s1=1/xi or $value =~ /exec(\s|\+)+(s|x)p\w+/xi | |
764 | 0 | 0 | 64 | $value =~ m[((\%3C)|<)((\%2F)|/)*[a-z0-9\%]+((\%3E)|>)]xi or $value =~ /((\%3C)|<)[^\n]+((\%3E)|>)/i |
1058 | 1 | 0 | 13 | $agent =~ m[(android|bb\d+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino]i or substr($ENV{'HTTP_USER_AGENT'}, 0, 4) =~ m[1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-]i |
1320 | 0 | 0 | 3 | not defined $dir or length $dir == 0 |
1321 | 1 | 2 | 0 | $self->{'logdir'} ||= $dir |
1401 | 1 | 1 | 0 | $referrer =~ /\)/ or &List::MoreUtils::any(sub { $_ =~ /^$referrer/; } , @crawler_lists) |
1509 | 0 | 2 | 6 | $browser->google || $browser->msn || $browser->baidu || $browser->altavista || $browser->yahoo || $browser->bingbot |
1521 | 0 | 0 | 0 | gethostbyaddr(inet_aton($remote), 2) || $remote |
1681 | 0 | 1 | 3 | $method eq "OPTIONS" or $method eq "DELETE" |