Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the HTTP-BrowserDetect CPAN distribution.

Report information
The Basics
Id:
41541
Status:
resolved
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
cpan.org [...] binary.co.uk
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
0.99
Fixed in:
(no value)



Subject: Server logs many "Use of uninitialized value in division (/)"
In my server logs I see many errors like: Use of uninitialized value in division (/) at /usr/local/share/perl/5.8.4/HTTP/BrowserDetect.pm line 142. Use of uninitialized value in modulus (%) at /usr/local/share/perl/5.8.4/HTTP/BrowserDetect.pm line 143. These are casued by an unknown browser which reports itself as: Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 UP.Link/6.3.1.15.0 i.e. Safari with no minor version number. I have patched the code to make it more robust in this respect. See attached diff output.
Subject: diff-BrowserDetect-0.99.txt
*** BrowserDetect.pm 2008-12-08 10:20:54.000000000 +0000 --- orig.BrowserDetect.pm 2007-02-22 16:49:51.000000000 +0000 *************** *** 135,147 **** ($safari_build,$safari_minor) = ($ua =~ / safari \/ ! ( [\d]+ ) # Major version number is everything before first dot ! (?: \. # The first dot ! ( [\d]+ ))? # Minor version number is digits after first dot /x); ! $major = int(($safari_build || 0) / 100); ! $minor = int(($safari_build || 0) % 100) / 100; ! $beta = $safari_minor || 0; #print "major=$major minor=$minor beta=$beta\n"; } --- 135,147 ---- ($safari_build,$safari_minor) = ($ua =~ / safari \/ ! ( [^\.]* ) # Major version number is everything before first dot ! (?: # The first dot ! ( [\d]* ))? # Minor version nnumber is digits after first dot /x); ! $major = int($safari_build / 100); ! $minor = int($safari_build % 100) / 100; ! $beta = $safari_minor; #print "major=$major minor=$minor beta=$beta\n"; } ***************
Thanks very much for your patch. This appears to be fixed in 1.00 I've added your test case to 1.01 Best, Olaf


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.