Subject: | Doesn't work with slashes (/) in User agent names |
Date: | Tue, 09 Aug 2016 17:52:04 +0300 |
To: | bug-WWW-RobotRules [...] rt.cpan.org |
From: | Vitaly Golubev <vgolubev [...] tcinet.ru> |
Hello
version: 6.02
Doesn't work with slashes (/) in User agent names - it looks that the problem is in is_me function.
According existing comments arguments should be swapped for index function. It started to work after this correction.
sub is_me {
my($self, $ua_line) = @_;
my $me = $self->agent;
# See whether my short-name is a substring of the
# "User-Agent: ..." line that we were passed:
#wrong order if(index(lc($me), lc($ua_line)) >= 0) {
if(index(lc($ua_line), lc($me)) >= 0) {
return 1;
}
else {
return '';
}
}