note 57765 added to function.is-readable
| From: | DrTebi at yahoo dot com | Date: | Thu, 13 Oct 2005 16:22:56 +0000 |
| Subject: | note 57765 added to function.is-readable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-96967@lists.php.net to get a copy of this message | ||
Be careful when using is_readable on symbolic links.
is_readable will return true if the file the symbolic link is pointing to is readable.
The problem is that if the server does NOT allow to follow symbolic links, is_readable will still
return true, but e.g. redirecting to the sybolic link will not work. For Apache, make sure that at
the server, virtual host configuration level, or inside a directory container you have set
Options +FollowSymLinks
As an example, let's say you have at the document root directory:
index.php -- the script using is_readable
my_linked_page.html -- a regular HTML page
my_link -- a link pointing to my_linked_page.html
Now in index.php:
<?php
if (is_readable('my_link')) {
header('Location: /my_link');
}
?>
If FollowSymLinks is forbidden, this will not work, if allowed, it will.
----
Manual Page -- http://www.php.net/manual/en/function.is-readable.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57765
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57765&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57765&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57765&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57765&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57765&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57765&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57765&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57765&report=yes
Search -- http://master.php.net/manage/user-notes.php