[interchange] Update routine to recognize "RobotUAFinal"
David Christensen <[email protected]> Tue, 17 Jan 2017 22:18:56 +0000
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 12928a38c9a2ab53384f5f48130401dd8b3348f7 Author: David Christensen <[email protected]> Date: Tue Jan 17 16:17:26 2017 -0600 Update routine to recognize "RobotUAFinal" lib/Vend/Server.pm | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) --- diff --git a/lib/Vend/Server.pm b/lib/Vend/Server.pm index a03248d..a7eb80b 100644 --- a/lib/Vend/Server.pm +++ b/lib/Vend/Server.pm @@ -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) { @@ -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;