diff options
author | Jerome Loyet <fat@php.net> | 2012-09-27 23:57:06 +0200 |
---|---|---|
committer | Jerome Loyet <fat@php.net> | 2012-09-27 23:57:06 +0200 |
commit | 0bffdd723fb1acbc8b1ef62768fa2f33c2d02bbc (patch) | |
tree | 04bbcd1a5da16ea5246d39c1bcae45b9eb67c526 /ext/zip/php_zip.c | |
parent | 1fa8ecd082607858084994ad7081ef06e37db5f5 (diff) | |
parent | 6a50a8640c562a41d90c7ab46affa767b97d2621 (diff) | |
download | php-git-0bffdd723fb1acbc8b1ef62768fa2f33c2d02bbc.tar.gz |
Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src: (367 commits)
fix unix/win dir separators
Fix bug #63173: Crash when invoking invalid array callback
Correct the test summary
Fixed bug #60723 (error_log error time has changed to UTC ignoring default timezo)
Fixed bug #60723 (error_log error time has changed to UTC ignoring default timezo)
Avoid calling select if maxfd returned by curl_multi_fdset is -1
Fixing NEWS file
Fixed bug #63111 (is_callable() lies for abstract static method)
updated lib versions
Fix folding
fix bug #63015 (Incorrect arginfo for DOMErrorHandler)
Bug #63000: MCAST_JOIN_GROUP on OSX is broken
Fixed bug #61442 (exception threw in __autoload can not be catched)
Merging PR #116
Merged GitHub PR #190: Support for the HTTP PATCH method in CLI webserver
updated libary versions
split tests for the new zlib version on win
Fixed Bug #63103 (ext\curl\tests\bug62839.phpt broken)
update news
Support building PHP with the native client toolchain.
...
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r-- | ext/zip/php_zip.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 55386558b6..74f868b5c3 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1152,7 +1152,13 @@ static void php_zip_free_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC) if (zr_rsrc) { if (zr_rsrc->zf) { - zip_fclose(zr_rsrc->zf); + if (zr_rsrc->zf->za) { + zip_fclose(zr_rsrc->zf); + } else { + if (zr_rsrc->zf->src) + zip_source_free(zr_rsrc->zf->src); + free(zr_rsrc->zf); + } zr_rsrc->zf = NULL; } efree(zr_rsrc); @@ -1321,9 +1327,8 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_open) } /* }}} */ -/* {{{ proto void zip_entry_close(resource zip_ent) +/* {{{ proto bool zip_entry_close(resource zip_ent) Close a zip entry */ -/* another dummy function to fit in the old api*/ static PHP_NAMED_FUNCTION(zif_zip_entry_close) { zval * zip_entry; @@ -1334,8 +1339,8 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_close) } ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry); - /* we got a zip_entry resource, be happy */ - RETURN_TRUE; + + RETURN_BOOL(SUCCESS == zend_list_delete(Z_LVAL_P(zip_entry))); } /* }}} */ @@ -2863,7 +2868,7 @@ static PHP_MINFO_FUNCTION(zip) php_info_print_table_row(2, "Zip", "enabled"); php_info_print_table_row(2, "Extension Version","$Id$"); php_info_print_table_row(2, "Zip version", PHP_ZIP_VERSION_STRING); - php_info_print_table_row(2, "Libzip version", "0.9.0"); + php_info_print_table_row(2, "Libzip version", LIBZIP_VERSION); php_info_print_table_end(); } |