summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2021-01-25 17:12:48 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2021-01-25 18:47:15 +0100
commit61ed904cecbfd2eb6e5c39c22de3c215a2aee722 (patch)
tree694246b8777f3dd7c4cac5ac41e2a2a80bb0e717
parent3f183bbcf8eb007eff094228f9b3f05682d207c4 (diff)
downloadphp-git-61ed904cecbfd2eb6e5c39c22de3c215a2aee722.tar.gz
Fix #75850: Unclear error message wrt. __halt_compiler() w/o semicolon
We add the failure reason to the error message. Closes GH-6638.
-rw-r--r--NEWS4
-rw-r--r--ext/phar/phar.c2
-rw-r--r--ext/phar/tests/phar_stub_error.phpt2
3 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index f3f0716725..00fb7f75c2 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2021, PHP 7.4.16
+- Phar:
+ . Fixed bug #75850 (Unclear error message wrt. __halt_compiler() w/o
+ semicolon) (cmb)
+
- Zip:
. Fixed bug #80648 (Fix for bug 79296 should be based on runtime version).
(cmb, Remi)
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 9b21eb7e2a..2749283ff5 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -2602,7 +2602,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
php_stream_close(newfile);
if (error) {
- spprintf(error, 0, "illegal stub for phar \"%s\"", phar->fname);
+ spprintf(error, 0, "illegal stub for phar \"%s\" (__HALT_COMPILER(); is missing)", phar->fname);
}
if (free_user_stub) {
zend_string_free(suser_stub);
diff --git a/ext/phar/tests/phar_stub_error.phpt b/ext/phar/tests/phar_stub_error.phpt
index 065078d296..ab92a05b51 100644
--- a/ext/phar/tests/phar_stub_error.phpt
+++ b/ext/phar/tests/phar_stub_error.phpt
@@ -48,7 +48,7 @@ __HALT_COMPILER();
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
bool(true)
-Exception: illegal stub for phar "%sphar_stub_error.phar.php"
+Exception: illegal stub for phar "%sphar_stub_error.phar.php" (__HALT_COMPILER(); is missing)
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
bool(true)
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"