diff options
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 d4f77eb4ed..0355db48e5 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1616,6 +1616,7 @@ static ZIPARCHIVE_METHOD(close) struct zip *intern; zval *this = getThis(); ze_zip_object *ze_obj; + int err; if (!this) { RETURN_FALSE; @@ -1625,7 +1626,8 @@ static ZIPARCHIVE_METHOD(close) ze_obj = (ze_zip_object*) zend_object_store_get_object(this TSRMLS_CC); - if (zip_close(intern)) { + if (err = zip_close(intern)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, zip_strerror(intern)); zip_discard(intern); } @@ -1634,7 +1636,11 @@ static ZIPARCHIVE_METHOD(close) ze_obj->filename_len = 0; ze_obj->za = NULL; - RETURN_TRUE; + if (!err) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } } /* }}} */ |