Skip to content

Commit 0927309

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #53898 (PHAR reports invalid error message, when the directory does not exist).
1 parent fefe9fc commit 0927309

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

ext/phar/phar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int al
12651265
if (ext_len == -2) {
12661266
spprintf(error, 0, "Cannot create a phar archive from a URL like \"%s\". Phar objects can only be created from local files", fname);
12671267
} else {
1268-
spprintf(error, 0, "Cannot create phar '%s', file extension (or combination) not recognised", fname);
1268+
spprintf(error, 0, "Cannot create phar '%s', file extension (or combination) not recognised or the directory does not exist", fname);
12691269
}
12701270
}
12711271
return FAILURE;

ext/phar/tests/bug46032.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ new phardata('0000000000000000000');
2727
%string|unicode%(%d) "%smytest"
2828
%string|unicode%(%d) "%smytest"
2929

30-
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar '0000000000000000000', file extension (or combination) not recognised' in %sbug46032.php:%d
30+
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
3131
Stack trace:
3232
#0 %sbug46032.php(%d): PharData->__construct('000000000000000...')
3333
#1 {main}

ext/phar/tests/phar_construct_invalidurl.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ try {
2626
--EXPECT--
2727
Cannot create a phar archive from a URL like "http://should.fail.com". Phar objects can only be created from local files
2828
Cannot create a phar archive from a URL like "http://". Phar objects can only be created from local files
29-
Cannot create phar 'http:/', file extension (or combination) not recognised
29+
Cannot create phar 'http:/', file extension (or combination) not recognised or the directory does not exist
3030
===DONE===

ext/phar/tests/zip/odt.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ phar://%sodt.odt%cmeta.xml
3131
phar://%sodt.odt%cmimetype
3232
phar://%sodt.odt%csettings.xml
3333
phar://%sodt.odt%cstyles.xml
34-
Cannot create phar '%sodt.odt', file extension (or combination) not recognised
34+
Cannot create phar '%sodt.odt', file extension (or combination) not recognised or the directory does not exist
3535
===DONE===

0 commit comments

Comments
 (0)