php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57684 Relative paths are resolved relative to PHP binary
Submitted: 2007-05-25 17:17 UTC Modified: 2008-01-29 22:29 UTC
From: edwardzyang at thewritingpot dot com Assigned:
Status: Closed Package: svn (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2007-05-25 17:17 UTC] edwardzyang at thewritingpot dot com
Description:
------------
Some SVN functions modify the local filesystem, such as svn_checkout(), and accordingly accept target paths to perform the operations in. Some strange behavior happens when you pass a relative path to these functions: the path is resolved as if the current working directory was the one that contains the PHP binary.

The wrapper code needs to normalize the relative paths according to the current working directory, which shouldn't be too difficult as many other functions need to do the same thing. Users can workaround this problem by always specifying absolute paths (possibly using dirname(__FILE__))

Reproduce code:
---------------
<?php
svn_checkout('http://www.example.com/svnroot', 'target-directory');
?>

Assuming that http://www.example.com/svnroot is a valid repository directory, /home/example/scripts is the current working directory, and PHP binaries are at /usr/bin

Expected result:
----------------
SVN repository is checked out at /home/example/scripts/target-directory

Actual result:
--------------
SVN repository attempts to be checked out at /usr/bin/target-directory

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-29 22:29 UTC] alan at akbkhome dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

although it's missing a commit message.. (merged with 11153)
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 07:01:25 2019 UTC