Skip Menu |

This queue is for tickets about the HTML-ParseBrowser CPAN distribution.

Report information
The Basics
Id: 66505
Status: resolved
Priority: 0/
Queue: HTML-ParseBrowser

People
Owner: Nobody in particular
Requestors: support [...] bettercgi.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1_0
Fixed in: 1.01



Subject: detect Windows 7, Windows 8
Date: Wed, 9 Mar 2011 13:56:54 -0600
To: bug-HTML-ParseBrowser [...] rt.cpan.org
From: Ray Morris <support [...] bettercgi.com>
This patch adds detection of Windows 7 (version 6.1) and Windows 8 (version 6.2). @@ -84,7 +84,11 @@ if ($browser->{osvers} >= 5) { if ($browser->{osvers} >= 5.1) { if ($browser->{osvers} >= 6) { - if ($browser->{osvers} >= 6.06) { + if ($browser->{osvers} = 6.2) { + $browser->{osvers} = '8' + if ($browser->{osvers} = 6.1) { + $browser->{osvers} = '7'; + elsif ($browser->{osvers} >= 6.06) { $browser->{osvers} = 'Server 2008'; } else { -- Ray Morris support@bettercgi.com Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php
Subject: Re: [rt.cpan.org #66505] AutoReply: detect Windows 7, Windows 8
Date: Wed, 9 Mar 2011 15:03:50 -0600
To: bug-HTML-ParseBrowser [...] rt.cpan.org
From: Ray Morris <support [...] bettercgi.com>
I should know better than to post a patch without thoroughly testing it. The above has "=" where it should have "==" and probably other errors due to funky logic. This should be better, with cleaner logic as well: if (/^Win/) { next if ( /Windows-Media-Player/ && defined($browser->{ostype}) ); $browser->{os} = $_; $browser->{ostype} = 'Windows'; if (/ /) { (undef, $browser->{osvers}) = split / /, $_, 2; if ($browser->{osvers} =~ /^NT/) { $browser->{ostype} = 'Windows'; (undef, $browser->{osvers}) = split / /, $browser->{osvers}, 2; if ($browser->{osvers} == 6.2) { $browser->{osvers} = '8'; } elsif ($browser->{osvers} == 6.1) { $browser->{osvers} = '7'; } elsif ($browser->{osvers} == 6.06) { $browser->{osvers} = 'Server 2008'; } elsif ($browser->{osvers} == 6.0) { $browser->{osvers} = 'Vista'; } elsif ($browser->{osvers} == 5.1) { $browser->{osvers} = 'XP'; } elsif ($browser->{osvers} == 5.01) { $browser->{osvers} = '2000 SP1'; } elsif ($browser->{osvers} == 5.0) { $browser->{osvers} = '2000'; } else { $browser->{ostype} = 'Windows NT'; } } } elsif (/Win(\w\w)/i) { $browser->{osvers} = $1; } if (lc $browser->{osvers} =~ /^9x/) { $browser->{osvers} = 'Me'; } } -- Ray Morris sup