php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53898 PHAR reports invalid error message, when the directory does not exist
Submitted: 2011-02-01 09:55 UTC Modified: 2011-02-01 15:01 UTC
From: nightstorm at tlen dot pl Assigned: iliaa
Status: Closed Package: PHAR related
PHP Version: 5.3.5 OS: Arch Linux x86_64
Private report: No CVE-ID:
 [2011-02-01 09:55 UTC] nightstorm at tlen dot pl
Description:
------------
When we try to create a PHAR archive, and the directory, where we want to save it does not exist, PHAR complains about invalid file extension, instead of informing that there is a problem with accessing the requested location. This is a bit confusing.

Test script:
---------------
<?php
// assume that "./dummy/" does not exist.
$phar = new Phar('./dummy/archive.phar');

Expected result:
----------------
Cannot create phar './dummy/archive.phar', invalid path in pharbuild.php on line 2
(or something like that)

Actual result:
--------------
UnexpectedValueException: Cannot create phar './dummy/archive.phar', file extension (or combination) not recognised in pharbuild.php on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-01 15:01 UTC] iliaa@php.net
Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=307915
Log: Fixed bug #53898 (PHAR reports invalid error message, when the directory does not exist).
 [2011-02-01 15:01 UTC] iliaa@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa
 [2011-02-01 15:01 UTC] iliaa@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 21:01:56 2014 UTC