Subject: | Debian version of Iceweasel identified as Mozilla/5.0 |
The Debian version of IceWeasel (Firefox fork) uses the following
UserAgent String:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090730
Iceweasel/3.5.1 (Debian-3.5.1-1)
Both the official version and CHORNY's version 1.1 parses this as
Mozilla/5.0. This is due to everything between parentheses is grabbed as
'detail' with a greedy regexp.
Changing this piece of code at the top of the Parse subroutine fixes the
problem:
if ($useragent =~ s/\((.*)\)//) {
$browser->{detail} = $1;
}
to
if ($useragent =~ s/\((.*?)\)//) {
$browser->{detail} = $1;
}
Mapping Iceweasel to Mozilla at the end of the parsing might be useful
too.