Ticket #2784: browser_version_regex_fix.diff
| File browser_version_regex_fix.diff, 1.9 kB (added by bgreenlee, 6 months ago) |
|---|
-
test/unit/core.js
53 53 }); 54 54 55 55 test("browser", function() { 56 expect(1 3);56 expect(14); 57 57 var browsers = { 58 58 //Internet Explorer 59 59 "Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)": "6.0", 60 60 "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)": "7.0", 61 "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)": "7.0", 61 62 /** Failing #1876 62 63 * "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)": "7.0", 63 64 */ … … 82 83 "Other browser's user agent 1.0":null 83 84 }; 84 85 for (var i in browsers) { 85 var v = i.toLowerCase().match( /.+ (?:rv|it|ra|ie)[\/: ]([\d.]+)/ ); // RegEx from Core jQuery.browser.version check86 var v = i.toLowerCase().match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)(?!.+opera)/ ); // RegEx from Core jQuery.browser.version check 86 87 version = v ? v[1] : null; 87 88 equals( version, browsers[i], "Checking UA string" ); 88 89 } -
src/core.js
