php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57921 cli_arg_typ_filenew does now create full path to relative files corectly
Submitted: 2007-11-20 17:52 UTC Modified: 2007-11-22 13:32 UTC
From: urkle@php.net Assigned: urkle (profile)
Status: Closed Package: phar (PECL)
PHP Version: Irrelevant OS: fedora 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: urkle@php.net
New email:
PHP Version: OS:

 

 [2007-11-20 17:52 UTC] urkle@php.net
Description:
------------
If passed "-f test.phar"  it will try to use "/home/myuserest.phar" as $d ends up being "."

(stupid PECL bug system won't let me add a comment to an existing issue)

Reproduce code:
---------------
Patch:
diff -ur T/clicommand.inc phar/clicommand.inc
--- old/clicommand.inc	2007-11-20 17:23:27.000000000 -0500
+++ new/clicommand.inc	2007-11-20 17:38:02.000000000 -0500
@@ -214,12 +214,13 @@
     static function cli_arg_typ_filenew($arg, $cfg, $key)
     {
         $d = dirname($arg);
+        $b = basename($arg);
         $f = realpath($d);
         
         if ($f === false) {
             self::error("Path for file '$arg' does not exist.\n");
         }
-        return $f . substr($arg, strlen($d));;
+        return $f . '/' . $b;
     }
 
     static function cli_arg_typ_filecont($arg, $cfg, $key)



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-22 13:32 UTC] greg at chiaraquartet dot net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC