From:             
Operating system: Windows 7, Debian
PHP version:      5.3.6
Package:          Safe Mode/open_basedir
Bug Type:         Bug
Bug description:is_dir() called on file with trailing slash to throw warning if 
open_basedir

Description:
------------
is_dir throws an error if:

- open_basedir is in effect

- called upon a file

- the path is terminated with a slash



CLI Tested on Windows:

php -d open_basedir=/ -r "var_dump(is_dir('C:/Windows/write.exe'));"

#bool(false)

php -d open_basedir=/ -r "var_dump(is_dir('C:/Windows/write.exe/'));"

#warning



CLI Not tested on Linux, should be like this:

php -d open_basedir=/ -r "var_dump(is_dir('/etc/fstab'));"



Apache2 module tested on Debian, see test script.

Test script:
---------------
<?php



echo PHP_VERSION . PHP_EOL;

ini_set('display_errors', true);

error_reporting(E_ALL);

var_dump(is_dir(__FILE__ . '/'));



Expected result:
----------------
5.2.9-0.dotdeb.1 bool(false)

Actual result:
--------------
5.3.5-0.dotdeb.0

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect.
File(/var/www/vhosts/blah/subdomains/bleah/httpdocs/phpinfo.php/) is not
within the allowed path(s):
(/var/www/vhosts/blah/subdomains/bleah/httpdocs:/tmp) in
/var/www/vhosts/blah/subdomains/bleah/httpdocs/phpinfo.php on line 7

bool(false)

-- 
Edit bug report at http://bugs.php.net/bug.php?id=54419&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=54419&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=54419&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=54419&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=54419&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54419&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=54419&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=54419&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=54419&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=54419&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=54419&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=54419&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=54419&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=54419&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=54419&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54419&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54419&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=54419&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=54419&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=54419&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=54419&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=54419&r=mysqlcfg

Reply via email to