php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38724 is_readable() *is* affected by safe_mode restrictions
Submitted: 2006-09-05 16:14 UTC Modified: 2007-08-17 16:39 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mp at webfactory dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mp at webfactory dot de
New email:
PHP Version: OS:

 

 [2006-09-05 16:14 UTC] mp at webfactory dot de
Description:
------------
http://de.php.net/is_readable states that is_readable() is not subject to safe_mode restrictions.

With the fix for bug #37987 this is wrong, is_readable() behaves like file_exists() does, and the documentation for file_exists() explicitly tells about this behaviour.


Reproduce code:
---------------
<?php
print PHP_VERSION . "\n";
var_dump(ini_get('safe_mode'));
var_dump(file_exists('/etc/hosts'));
var_dump(is_readable('/etc/hosts'));
?>

mp@dev:~$ php bug.php
5.1.6
string(0) ""
bool(true)
bool(true)

mp@dev:~$ php -d safe_mode=1 bug.php    
5.1.6
string(1) "1"
bool(false)
bool(false)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-17 16:39 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"Safe mode limitations are not taken into account before PHP 5.1.5."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 14:00:01 2025 UTC