From: Ilia Alshanetsky Date: Tue, 1 Feb 2011 14:01:00 +0000 (+0000) Subject: Fixed bug #53898 (PHAR reports invalid error message, when the directory does not... X-Git-Tag: php-5.3.6RC1~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=baf5d66614583aa15de8b9bc1f469ec9a3b2a216;p=php Fixed bug #53898 (PHAR reports invalid error message, when the directory does not exist). --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 08b74f8665..9026be202d 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1265,7 +1265,7 @@ int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int al if (ext_len == -2) { spprintf(error, 0, "Cannot create a phar archive from a URL like \"%s\". Phar objects can only be created from local files", fname); } else { - spprintf(error, 0, "Cannot create phar '%s', file extension (or combination) not recognised", fname); + spprintf(error, 0, "Cannot create phar '%s', file extension (or combination) not recognised or the directory does not exist", fname); } } return FAILURE; diff --git a/ext/phar/tests/bug46032.phpt b/ext/phar/tests/bug46032.phpt index 5a88d5b426..7700e9b6f8 100644 --- a/ext/phar/tests/bug46032.phpt +++ b/ext/phar/tests/bug46032.phpt @@ -27,7 +27,7 @@ new phardata('0000000000000000000'); %string|unicode%(%d) "%smytest" %string|unicode%(%d) "%smytest" -Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar '0000000000000000000', file extension (or combination) not recognised' in %sbug46032.php:%d +Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar '0000000000000000000', file extension (or combination) not recognised or the directory does not exist' in %sbug46032.php:%d Stack trace: #0 %sbug46032.php(%d): PharData->__construct('000000000000000...') #1 {main} diff --git a/ext/phar/tests/phar_construct_invalidurl.phpt b/ext/phar/tests/phar_construct_invalidurl.phpt index cc1341500a..30a4687289 100644 --- a/ext/phar/tests/phar_construct_invalidurl.phpt +++ b/ext/phar/tests/phar_construct_invalidurl.phpt @@ -26,5 +26,5 @@ try { --EXPECT-- Cannot create a phar archive from a URL like "http://should.fail.com". Phar objects can only be created from local files Cannot create a phar archive from a URL like "http://". Phar objects can only be created from local files -Cannot create phar 'http:/', file extension (or combination) not recognised +Cannot create phar 'http:/', file extension (or combination) not recognised or the directory does not exist ===DONE=== diff --git a/ext/phar/tests/zip/odt.phpt b/ext/phar/tests/zip/odt.phpt index 1c903dd9d4..b007d447a8 100644 --- a/ext/phar/tests/zip/odt.phpt +++ b/ext/phar/tests/zip/odt.phpt @@ -31,5 +31,5 @@ phar://%sodt.odt%cmeta.xml phar://%sodt.odt%cmimetype phar://%sodt.odt%csettings.xml phar://%sodt.odt%cstyles.xml -Cannot create phar '%sodt.odt', file extension (or combination) not recognised +Cannot create phar '%sodt.odt', file extension (or combination) not recognised or the directory does not exist ===DONE===