php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60841 expand_filepath fails to resolve symlinks that point to \xxx\yyy
Submitted: 2012-01-22 21:16 UTC Modified: 2012-01-22 22:05 UTC
Votes:5
Avg. Score:4.0 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: cataphract@php.net Assigned: pajoye
Status: Assigned Package: Filesystem function related
PHP Version: 5.3.9 OS: Windows 7
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-01-22 21:16 UTC] cataphract@php.net
Description:
------------
If a path includes a symlink that points to a path like \xxx\yyy, PHP understands 
it as a relative path, while it's actually an absolute path (or quasi-absolute, 
as it doesn't have a drive letter).

Expected result:
----------------
foocontents

Actual result:
--------------
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>cd \

C:\>mkdir t

C:\>mkdir t\test

C:\>mklink /D t\testlink \t\test
symbolic link created for t\testlink <<===>> \t\test

C:\>echo foocontents > \t\testlink\foo

C:\>php -r "echo file_get_contents('t\testlink\foo');"

Warning: file_get_contents(t\testlink\foo): failed to open stream: No such file
or directory in Command line code on line 1

C:\>php -r "echo file_get_contents('t\test\foo');"
foocontents

C:\>type t\testlink\foo
foocontents

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-22 22:05 UTC] pajoye@php.net
It is not an absolute path but a relative path to the current drive.

It can have very different meanings withing a request (PWD and co). I remember to 
have made a doc about that back then, let me find it back and try to provide a fix 
or document it better.
 [2012-01-22 22:05 UTC] pajoye@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pajoye
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC