Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update routine to recognize "RobotUAFinal"
  • Loading branch information
David Christensen committed Jan 17, 2017
1 parent 77110c7 commit 12928a3
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lib/Vend/Server.pm
Expand Up @@ -286,7 +286,7 @@ EOF


sub check_is_robot {
my $ret = 1;
my $ret = 1;

#::logDebug("Check robot UA=$Global::RobotUA IP=$Global::RobotIP");
if ($Global::RobotIP and $CGI::remote_addr =~ $Global::RobotIP) {
Expand All @@ -303,13 +303,18 @@ sub check_is_robot {
$ret = 1;
}
}
unless ($Vend::Robot) {
if ($Global::NotRobotUA and $CGI::useragent =~ $Global::NotRobotUA) {
# do nothing
}
elsif ($Global::RobotUA and $CGI::useragent =~ $Global::RobotUA) {
#::logDebug("It is a robot by UA!");
$ret = 1;
if ($Global::RobotUAFinal and $CGI::useragent =~ $Global::RobotUAFinal) {
$ret = 1;
}
else {
unless ($Vend::Robot) {
if ($Global::NotRobotUA and $CGI::useragent =~ $Global::NotRobotUA) {
# do nothing
}
elsif ($Global::RobotUA and $CGI::useragent =~ $Global::RobotUA) {
#::logDebug("It is a robot by UA!");
$ret = 1;
}
}
}
return $ret;
Expand Down

0 comments on commit 12928a3

Please sign in to comment.