Modify ↓
Ticket #2413 (closed bug: duplicate)
incorrect browser version (1.2.3, not fixed)
| Reported by: | redguy | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.3 |
| Component: | core | Version: | 1.2.3 |
| Keywords: | browser version ie7 | Cc: | |
| Blocking: | Blocked by: |
Description
my browser (IE7 under Vista Ultimate) introduces himself as:
navigator Agent:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; .NET CLR 1.1.4322; FDM)
(notice the second occurance of compatible; MSIE 6.0) core jQuery, when getting browser version gets the second one, which is wrong...
changing line 1217 of full distribution ( 1216 line of core.js ) from:
version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
to
version: (userAgent.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
fixes this problem, but I haven't tested it on other browsers and configurations yet. It works in my case... the difference is in question mark after plus - which finds shortest matching string, so the re gets the first occurance of MSIE 7.0.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

#1537 is a duplicate of this bug, the given regexp should fix that one as well.