Bug #74501 [Com]: get_browser() generates incorrect error
| From: | spam2 at rhsoft dot net | Date: | Tue, 02 May 2017 12:08:33 +0000 |
| Subject: | Bug #74501 [Com]: get_browser() generates incorrect error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208907@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74501&edit=1
ID: 74501
Comment by: spam2 at rhsoft dot net
Reported by: dpatterson at dplhenterprises dot com
Summary: get_browser() generates incorrect error
Status: Not a bug
Type: Bug
Package: PHP options/info functions
Operating System: Ubuntu 16.0.4
PHP Version: 7.0.18
Block user comment: N
Private report: N
New Comment:
> Please check the error log. so there will be sure a warning
> about an unsuccessful read or alike
how does that change the fact that "Warning: get_browser(): browscap ini directive not
set" is wrong which is all that bugreport is about?
Previous Comments:
------------------------------------------------------------------------
[2017-05-02 11:43:13] ab@php.net
Thanks for the report. Please check the error log. The browcap.ini is checked with streams, so there
will be sure a warning about an unsuccessful read or alike.
Thanks.
------------------------------------------------------------------------
[2017-04-26 16:53:43] dpatterson at dplhenterprises dot com
Description:
------------
The get_browser() function can generate a "Warning: get_browser(): browscap ini directive not
set" error when the browscap ini directive *is* set.
The browscap file is read at run time. This means that the web server must be able to read it.
If the file's protection or ownership prevents the web server from reading it (e.g., if
it's owned by root), get_browser() will generate the "Warning: get_browser(): browscap ini
directive not set" error instead of reporting that the file can't be read.
Test script:
---------------
/*
* In php.ini:
* browscap = /etc/php/7.0/apache2/lite_php_browscap.ini
* lite_php_browscap.ini is owned by root
*/
$bData = get_browser(); // Results in incorrect error.
Expected result:
----------------
$bData contains an object describing the browser.
Actual result:
--------------
"Warning: get_browser(): browscap ini directive not set" error.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74501&edit=1