Closed Bug 471522 Opened 17 years ago Closed 17 years ago

OS sniffing doesn't properly detect OS X 10.5 (and others)

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.4

People

(Reporter: timeless, Assigned: timeless)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch fixup OS X sniffing code (obsolete) — — Splinter Review
this was written as a response to bug 468617 comment 10: it depends what i can get away with. Some of my code does use [8x] or \., but with this one clearly \. would fail for known inputs (it's always a good thing to have known inputs easily reachable. --- Matt, please accept a post fact r-. the patch in attachment 352105 [details] [diff] [review] doesn't work if I'm running 10.5 on PPC which is legal. Here are a couple more useragents GoogleEarth/4.2.0205.5730(Macintosh;Mac OS X (10.5.4);en;kml:2.2;client:Free;type:default) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b1) Gecko/2007110903 Firefox/3.0b1 Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O 10.5; en; rv:1.9b2pre) Gecko/2007111101 Camino/2.0a1pre (like Firefox/3.0b2pre) GoogleEarth/4.2.0205.5730(Macintosh;Mac OS X (10.5.4);en;kml:2.2;client:Free;type:default) iTunes/4.2 (Macintosh; U; PPC Mac OS X 10.2) Usually when I write patches for useragent sniffing, I actually spend some time to research them before I write them. It's not your fault, and I do appreciate that you did some research to find the safari useragent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1
Attachment #354806 - Flags: review?(wicked)
Comment on attachment 354806 [details] [diff] [review] fixup OS X sniffing code Seems to work on the test cases you provided and otherwise looks sane to me. Please fix following comment nits on checkin. >Index: enter_bug.cgi >=================================================================== >+ # Unfortunate, OS X 10.4 was the first to support Intel this is fallback support >+ # because some browsers refused to include the OS Version Nit: Rephrase this comment. Use "Unfortunately", add full stops after "Intel" and "Version", start "this" with capital T and rewrap to keep lines under 80 chars. >- /\(.*Mac OS X.*\)/ && do {push @os, ("Mac OS X 10.3", "Mac OS X 10.0", "Mac OS X");}; >+ push @os, ("Mac OS X 10.3", "Mac OS X 10.0", "Mac OS X"); Nit: Don't remove the "/\(.*Mac OS X.*\)/" match from this line to keep this in sync with other do blocks. This shouldn't affect the logic so I consider this a nit only. >+ # OS X 10.3 is the most likely default version of PowerPC Macs >+ # OS X 10.0 is more for configurations which didn't setup 10.x versions Nit: Correct the indentation of all the comment. Start either from same column as other comments in this sub (decrease indentation by 2 columns) or from same column as match lines (increase indentation appropriately). Remember to rewrap to keep lines under 80 chars.
Attachment #354806 - Flags: review?(wicked) → review+
Flags: approval?
Target Milestone: --- → Bugzilla 3.4
I want an updated patch with nits fixed before granting approval.
Whiteboard: [updated patch needed before approval]
Comment on attachment 354806 [details] [diff] [review] fixup OS X sniffing code LpSolit says we need an updated patch in order to check this in.
Attachment #354806 - Flags: review-
There's been no traction on getting an updated patch, so taking this out of the approval queue.
Flags: approval?
Fixes nits and adds support for OSX 10.6 (Snow Leopard). Tested with the following user-agents: > GoogleEarth/4.2.0205.5730(Macintosh;Mac OS X (10.5.4);en;kml:2.2;client:Free;type:default) > Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b1) Gecko/2007110903 Firefox/3.0b1 > Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O 10.5; en; rv:1.9b2pre) Gecko/2007111101 Camino/2.0a1pre (like Firefox/3.0b2pre) > iTunes/4.2 (Macintosh; U; PPC Mac OS X 10.2) > Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1 > Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 > Opera/9.64 (Macintosh; PPC Mac OS X; U; en) Presto/2.1.1 > Opera/9.64 (Macintosh; Intel Mac OS X; U; de) Presto/2.1.1 > Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20081212 > Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-gb) AppleWebKit/528.10+ (KHTML, like Gecko) Version/4.0dp1 Safari/526.11.2 > Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6; en-gb) AppleWebKit/530.1 (KHTML, like Gecko) Version/4.0 Safari/530.1 > Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; ru-ru) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16
Attachment #370358 - Flags: review?(wicked)
Attachment #370358 - Flags: review?(wicked) → review?(timeless)
Comment on attachment 370358 [details] [diff] [review] fixup OS X sniffing code v2 the goal of my changes was to optimize. there's no reason to recheck for OS X inside a block. that said, i don't care. thanks for adding snow.
Attachment #370358 - Flags: review?(timeless) → review+
Flags: approval3.4+
Flags: approval+
Whiteboard: [updated patch needed before approval]
Attachment #354806 - Attachment is obsolete: true
tip: Checking in enter_bug.cgi; /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v <-- enter_bug.cgi new revision: 1.170; previous revision: 1.169 done 3.3.4: Checking in enter_bug.cgi; /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v <-- enter_bug.cgi new revision: 1.169.2.1; previous revision: 1.169 done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: