Bug #53041 [Com]: is_file() and open_basedir

From: Date: Thu, 06 Mar 2014 14:27:06 +0000
Subject: Bug #53041 [Com]: is_file() and open_basedir
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184578@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53041&edit=1

 ID:                 53041
 Comment by:         lav at etersoft dot ru
 Reported by:        sunseb at live dot com
 Summary:            is_file() and open_basedir
 Status:             No Feedback
 Type:               Bug
 Package:            *Directory/Filesystem functions
 Operating System:   Linux
 PHP Version:        5.3.3
 Block user comment: N
 Private report:     N

 New Comment:

Still reproduced on 5.4.17.20130704:

Still said about open_basedir restriction when checking the path contains real file instead dir in
the middle of the path.


is_file('/home/my_file.txt/file');

where /home/my_file.txt is a real file.


Previous Comments:
------------------------------------------------------------------------
[2013-07-19 18:05:50] mail+php at requinix dot net

Related To: Bug #65211

------------------------------------------------------------------------
[2013-04-03 20:16:23] mail+php at requinix dot net

Related To: Bug #64573

------------------------------------------------------------------------
[2013-02-18 00:34:32] php-bugs at lists dot php dot net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

------------------------------------------------------------------------
[2011-07-21 10:57:15] pajoye@php.net

@kev at dewsolutions dot co dot uk


Given:

dirname(__FILE__) . '/index.php/test'

I suppose that index.php is a file, right?

------------------------------------------------------------------------
[2011-07-21 07:59:32] kev at dewsolutions dot co dot uk

Still occurs in PHP 5.3.6.

to replicate:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

echo 'testing open basedir problems <br />';

// append text to current directory name which should be the dir of open_basedir to trigger
open_basedir warning
echo 'checking ' . dirname(__FILE__) . 'test <br />';
var_dump(file_exists(dirname(__FILE__) . 'test'));

// no warning should occur here whether index.php exists or not
echo 'checking ' . dirname(__FILE__) . '/index.php <br />';
var_dump(file_exists(dirname(__FILE__) . '/index.php'));

// if index.php exists a open_basedir warning will be thrown
echo 'checking ' . dirname(__FILE__) . '/index.php/test <br />';
var_dump(file_exists(dirname(__FILE__) . '/index.php/test'));

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=53041


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=53041&edit=1


Thread (13 messages)

« previous php.bugs (#184578) next »