[PHP-DEV] PHP 4.0 Bug #9563: realpath() returns empty string when working directory is under a symbolic link From: agreenbu <email protected>
Date: 03/05/01

From: agreenbu <email protected>
Operating system: Solaris 2.7
PHP version: 4.0.4pl1
PHP Bug Type: Filesystem function related
Bug description: realpath() returns empty string when working directory is under a symbolic link

/opt/apache/htdocs is the Document Root for Apache.
/opt/apache/htdocs/directory is a symbolic link that points to /home/morespace/directory. Document /home/morespace/directory/username/index.php contains the code:

$RealPath = realpath(".");

if (!stristr($RealPath, $UserName)){
        echo "This directory does not belong to you. Attempt has been logged.";
        session_destroy();
        exit;
}

This code always fails because realpath(".") returns an empty string.

-- 
Edit Bug report at: http://bugs.php.net/?id=9563&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>