Re: Re: cvs: php4(PHP_4_3) / NEWS
| From: | Jay Smith | Date: | Fri, 16 May 2003 17:57:48 +0000 |
| Subject: | Re: Re: cvs: php4(PHP_4_3) / NEWS | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-1594@lists.php.net to get a copy of this message | ||
Since you're still doing some browscap stuff, feel like testing a patch? I
noticed today that some of the browsers reported by get_browser() are still
pretty inaccurate. (Mozilla for instance is especially bad -- I'm getting
it reported as "Netscape 5", despite the fact that it's clearly Mozilla
1.2.1.)
This patch (against HEAD) makes the browser_reg_compare() function a bit
more thourough in it's search for a browser. It doesn't bail out on the
first match it finds, for instance, as there are usually better matches
further down in the browscap.ini file.
I've run it against as many user agent strings as I could find, and it's
reporting things much better now. (Recognizing Mozilla, properly reporting
Win98 instead of WinME in certain cases, finding the .NET CLR, finally
reporting SunOS instead of linux, etc.)
It's slightly slower because of an extra hash lookup, but I think the slight
slow down is worth the extra precision. I can incorporate any further fixes
you have, if you'd like.
J
Uwe Schindler wrote:
> I told that a few days before... You should replace in browscap.ini the
> fopen by a zend_file_handle with type FD or FILENAME. I changed that and
> have a replacement for browscap.ini but I cannot submit it due to
> insufficient karma.
>
> In the patch is also fixed one bug in the regular expression generated.
>
> But Sasha should change the code, too.
>
Attachment: [text/x-diff] browscap.patch
Attachment: [text/x-diff] browscap.patch