Bug #78806 [Com]: Wrong open_basedir warning
| From: | michael dot vorisek at email dot cz | Date: | Tue, 12 Nov 2019 16:42:50 +0000 |
| Subject: | Bug #78806 [Com]: Wrong open_basedir warning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223690@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78806&edit=1
ID: 78806
Comment by: michael dot vorisek at email dot cz
Reported by: michael dot vorisek at email dot cz
Summary: Wrong open_basedir warning
Status: Duplicate
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows
PHP Version: 7.3.11
Block user comment: N
Private report: N
New Comment:
Yes, duplicate issue and presented also on linux, reported by many users.
I understand that it needs to be carefully designed to prevent open_basedir leaks with symlinks, but
it needs to be fixed for regular files.
Previous Comments:
------------------------------------------------------------------------
[2019-11-12 16:14:08] requinix@php.net
More specifically, it errors if you create a path that treats a file like a directory.
Duplicate of bug #52065.
------------------------------------------------------------------------
[2019-11-12 15:41:23] michael dot vorisek at email dot cz
Description:
------------
On Windows PHP emits a warning if file path consists of existing file and slash plus optionally
anything is appended. This issue should be fixes asap as it outputs unwanted output from core
function.
Test script:
---------------
(Windows + PHP 7.3 + PHP error reporting enabled + open_basedir set)
var_dump(file_exists(__FILE__));
var_dump(file_exists(__FILE__ . '/'));
Expected result:
----------------
bool(true)
(no warning)
bool(false)
Actual result:
--------------
bool(true)
Warning: file_exists(): open_basedir restriction in effect. File(C:/x/test.php/) is not within the
allowed path(s): (C:/x/) in xxx on line xxx
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78806&edit=1