#27839 [Opn->Bgs]: Similar problems to #27291 when using parse_ini_file() NOT get_browser()
| From: | iliaa@php.net | Date: | Fri, 02 Apr 2004 20:30:46 +0000 |
| Subject: | #27839 [Opn->Bgs]: Similar problems to #27291 when using parse_ini_file() NOT get_browser() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-57408@lists.php.net to get a copy of this message | ||
ID: 27839
Updated by: iliaa@php.net
Reported By: little_miss_goth at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Linux(/others?)
PHP Version: 4.3.4
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
Duplicate of bug #27372.
In both instances internal ini parsing mechanism is being
used.
Previous Comments:
------------------------------------------------------------------------
[2004-04-02 10:10:32] little_miss_goth at hotmail dot com
Description:
------------
I'm using the parse_ini_file() function as the basis for a
reimplementation of get_browser(). I'm having to process browscap.ini
without using the get_browser() function as the hosting people I'm
using won't set the browscap path in php.ini. Until fairly recently
this was working fine.
I'm receiving parse errors on the browscap.ini against the
"browser=Yahoo! Slurp" line, the same as Gary Keith mentions in one of
his comments in Bug #27291 [get_browser matches browscap.ini patterns
incorrectly].
The browscap.ini section that causes this reads:
[Mozilla/5.0 (compatible; Yahoo! Slurp;
http://help.yahoo.com/help/us/ysearch/slurp)]
parent=Yahoo
browser=Yahoo! Slurp
From the ChangeLog and #27291's comment listing, issues with
get_browser() have apparently been fixed in 4.3.5.
However, I'm not using get_browser(), and so I was wondering if the fix
implemented for that will also remedy the parse_ini_file() issue? For
example, does get_browser() call parse_ini_file() [or does the engine
do something along those lines]?
Oh, BTW, editting the browscap.ini manually so that "browser=Yahoo
Slurp" rather than the sourced "browser=Yahoo! Slurp" causes everything
to function properly.
The hosting people are running under PHP 4.3.4 at the moment.
Reproduce code:
---------------
function browserCapabilities($userAgent, $browscapLocation) {
[..Some initialisation if variables..]
print " Processing: $userAgent\n";
$this->browscapFile = parse_ini_file ($browscapLocation, TRUE);
[..Some array processing..]
[.. Print statements for browser capabilities..]
}
Expected result:
----------------
Processing: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
(R1 1.3); .NET CLR 1.1.4322)
Browser supports JavaScript: Yes
Browser supports CSS Level 2: Yes
Browser is text-only: No
Browser is MSIE: Yes
Browser detection complete. Browser type set to: msie.
Actual result:
--------------
Processing: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
(R1 1.3); .NET CLR 1.1.4322)
<br />
<b>Warning</b>: Error parsing
/nfs/home/air-cr2/public_html/anneharris/includes/browscap.ini on line
521
in <b>/nfs/home/air-cr2/public_html/includes/processBrowscap.hpi</b>
on line <b>164</b><br />
Browser supports JavaScript: No
Browser supports CSS Level 2: No
Browser is text-only: No
Browser is MSIE: No
Browser detection complete. Browser type set to: incapable.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27839&edit=1