From 8559a2dbde15e48d9bbe69969e96905bb48e28df Mon Sep 17 00:00:00 2001 From: Steph Fox Date: Tue, 29 Apr 2008 12:06:54 +0000 Subject: [PATCH] - Prevent phars with empty manifests flushing to disk - This would've fixed that test... removing clean section @Greg: I commented out the call that breaks the Windows build, pending a decision about its future. --- ext/phar/phar.c | 4 ++++ ext/phar/phar_object.c | 3 ++- ext/phar/tests/badparameters.phpt | 4 ---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 1ca84aa542..e201d59de1 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2092,6 +2092,10 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, return EOF; } + if (!zend_hash_num_elements(&phar->manifest)) { + return EOF; + } + if (phar->is_zip) { return phar_zip_flush(phar, user_stub, len, convert, error TSRMLS_CC); } diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 4921d51159..33ee816997 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -320,9 +320,10 @@ static int phar_file_action(phar_entry_data *phar, char *mime_type, int code, ch if (EG(return_value_ptr_ptr) && *EG(return_value_ptr_ptr)) { zval_ptr_dtor(EG(return_value_ptr_ptr)); } + /* if (EG(exception)) { zend_throw_exception_internal(NULL TSRMLS_CC); - } + } */ zend_bailout(); } return PHAR_MIME_PHP; diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt index ad61e03377..a6ce37b3f9 100644 --- a/ext/phar/tests/badparameters.phpt +++ b/ext/phar/tests/badparameters.phpt @@ -143,10 +143,6 @@ echo $e->getMessage() . "\n"; } ?> ===DONE=== ---CLEAN-- - --EXPECTF-- Warning: Phar::mungServer() expects parameter 1 to be array, string given in %sbadparameters.php on line %d -- 2.50.1