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.
At 18:08 16.05.2003 +0300, you wrote:
That lexer stuff seems to have broken the browscap stuff.. See bug #23657 --Jani--
Uwe Schindler
Addr 1: Bamberger Str. 24a, D-96049 Bamberg
Addr 2: Drausnickstr. 153, D-91052 Erlangen
http://www.thetaphi.de - http:///www.schindlers-software.de
eMails: uwe@thetaphi.de (private); info@schindlers-software.de (company)
Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)
Schindlers Software - Home of Schindlers PC-LATEIN 3.10
DIE Software zum Lateinlernen!
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.
I think the most important thing is to match for the WHOLE String, so the
pattern must contain ^....$. This is fixed in PHP5 but jay did not want to
put it into 4.3.2
But adding you code looks pretty good. Longer strings that match are more
accurate.
And by the way: using the browscap.c from the PHP5 tree at this time does
not lead to the segmentation fault in bug #23657. Compiling with the PHP
4.3.2RC3 also segfaults on NSAPI.
Uwe
At 13:57 16.05.2003 -0400, you wrote:
Since you're still doing some browscap stuff, feel like testing a patch? I
noticed today that some of the browsers reported byget_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.
--
Uwe Schindler
Addr 1: Bamberger Str. 24a, D-96049 Bamberg
Addr 2: Drausnickstr. 153, D-91052 Erlangen
http://www.thetaphi.de - http:///www.schindlers-software.de
eMails: uwe@thetaphi.de (private); info@schindlers-software.de (company)
Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)
Schindlers Software - Home of Schindlers PC-LATEIN 3.10
DIE Software zum Lateinlernen!
I would have liked to have committed to PHP_4_3, but 4.3.2RC1 had already
rolled, and new features shouldn't have been added. Maybe for 4.3.3.
I haven't seen the NSAPI problem yet, but I'll try it today. The segfault
should be fixed (Ilia, I believe?) in 4_3, I think.
J
Uwe Schindler wrote:
I think the most important thing is to match for the WHOLE String, so the
pattern must contain ^....$. This is fixed in PHP5 but jay did not want to
put it into 4.3.2
But adding you code looks pretty good. Longer strings that match are more
accurate.And by the way: using the browscap.c from the PHP5 tree at this time does
not lead to the segmentation fault in bug #23657. Compiling with the PHP
4.3.2RC3 also segfaults on NSAPI.Uwe
There is no special problem in NSAPI. It only confimed the bug and said
that with the patch of you (I need it on my webserver because browscap does
NOT work correct even in 4.3.2) the problem disappeared, too.
So for my point of view the use of the PHP5 source of browscap.c was
better. And if you do not want to use it in 4.3.2 we should add the $ and ^
to the regex created.
At 14:33 16.05.2003 -0400, you wrote:
I would have liked to have committed to PHP_4_3, but 4.3.2RC1 had already
rolled, and new features shouldn't have been added. Maybe for 4.3.3.I haven't seen the NSAPI problem yet, but I'll try it today. The segfault
should be fixed (Ilia, I believe?) in 4_3, I think.J
Uwe Schindler
Addr 1: Bamberger Str. 24a, D-96049 Bamberg
Addr 2: Drausnickstr. 153, D-91052 Erlangen
http://www.thetaphi.de - http:///www.schindlers-software.de
eMails: uwe@thetaphi.de (private); info@schindlers-software.de (company)
Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)
Schindlers Software - Home of Schindlers PC-LATEIN 3.10
DIE Software zum Lateinlernen!