CC: | david [...] axiombox.com |
Subject: | Invalid version format on iPhone user agent |
We are using Parse::HTTP::UserAgent heavily on production environments. We parse a lot of
different user strings. Recently we detected this issue on this module:
Invalid version format (fractional part required) at
/opt/local/lib/perl5/site_perl/5.12.3/Parse/HTTP/UserAgent.pm line 254.
You can reproduce this with the following code:
use Modern::Perl;
use Parse::HTTP::UserAgent;
use Data::Dumper;
my $str = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1 like Mac OS X; 6534.46)
AppleWebKit/en_SG (KHTML, like Gecko) Mobile/8C148 Safari/6533.18.5';
my $ua = Parse::HTTP::UserAgent->new( $str );
print Dumper $ua;
That user agent string is a real life iPhone one.