]> granicus.if.org Git - php/commitdiff
- Prevent phars with empty manifests flushing to disk
authorSteph Fox <sfox@php.net>
Tue, 29 Apr 2008 12:06:54 +0000 (12:06 +0000)
committerSteph Fox <sfox@php.net>
Tue, 29 Apr 2008 12:06:54 +0000 (12:06 +0000)
- 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
ext/phar/phar_object.c
ext/phar/tests/badparameters.phpt

index 1ca84aa5427eb6b7da3540ead5473d319b2cb1a8..e201d59de1fb518063bf1ffe9862c9c09c0378b2 100644 (file)
@@ -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);
        }
index 4921d51159b339af45879fccb914488ce4e09215..33ee81699721992fed6108d137782ea02d5ec6e8 100755 (executable)
@@ -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;
index ad61e033779662e81ed277d24e1800a97c48ddf8..a6ce37b3f9e620d61ea71989ceff234faa79013f 100644 (file)
@@ -143,10 +143,6 @@ echo $e->getMessage() . "\n";
 }
 ?>
 ===DONE===
---CLEAN--
-<?php 
-unlink(dirname(__FILE__) . '/whatever.tar');
-?>
 --EXPECTF--
 Warning: Phar::mungServer() expects parameter 1 to be array, string given in %sbadparameters.php on line %d