diff options
author | Christoph M. Becker <cmb@php.net> | 2015-09-05 00:43:41 +0200 |
---|---|---|
committer | Christoph M. Becker <cmb@php.net> | 2015-09-05 00:43:41 +0200 |
commit | 0836d6484cacfab2eac7b9fe3ca3e578ca0ced36 (patch) | |
tree | 279efc24597d34d15f5bb4c60d6230624ae6e22d /ext/zip/php_zip.c | |
parent | 539db00538baeb24ba0ca3524b7bef796430dd21 (diff) | |
parent | b59ea797f53f560ae79c55c1ca4956b5e77203d2 (diff) | |
download | php-git-0836d6484cacfab2eac7b9fe3ca3e578ca0ced36.tar.gz |
Merge branch 'PHP-5.6'
* PHP-5.6:
Fix #70322: ZipArchive::close() doesn't indicate errors
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r-- | ext/zip/php_zip.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index a723a187db..99adb723e3 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1495,6 +1495,7 @@ static ZIPARCHIVE_METHOD(close) struct zip *intern; zval *self = getThis(); ze_zip_object *ze_obj; + int err; if (!self) { RETURN_FALSE; @@ -1504,7 +1505,8 @@ static ZIPARCHIVE_METHOD(close) ze_obj = Z_ZIP_P(self); - if (zip_close(intern)) { + if (err = zip_close(intern)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, zip_strerror(intern)); zip_discard(intern); } @@ -1513,7 +1515,11 @@ static ZIPARCHIVE_METHOD(close) ze_obj->filename_len = 0; ze_obj->za = NULL; - RETURN_TRUE; + if (!err) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } } /* }}} */ |