From 84a080ef506c9e8a2d20529a88ff6622ecbecc42 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 6 Aug 2020 11:28:35 +0200 Subject: [PATCH] Avoid getThis() usages in zip extension There isn't any magic going on here, we can just use ZEND_THIS and assume it exists. --- ext/zip/php_zip.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 841488bd61..de3a695d96 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -2884,15 +2884,11 @@ static void _php_zip_progress_callback(zip_t *arch, double state, void *ptr) PHP_METHOD(ZipArchive, registerProgressCallback) { struct zip *intern; - zval *self = getThis(); + zval *self = ZEND_THIS; double rate; zval *callback; ze_zip_object *obj; - if (!self) { - RETURN_FALSE; - } - if (zend_parse_parameters(ZEND_NUM_ARGS(), "dz", &rate, &callback) == FAILURE) { return; } @@ -2942,14 +2938,10 @@ static int _php_zip_cancel_callback(zip_t *arch, void *ptr) PHP_METHOD(ZipArchive, registerCancelCallback) { struct zip *intern; - zval *self = getThis(); + zval *self = ZEND_THIS; zval *callback; ze_zip_object *obj; - if (!self) { - RETURN_FALSE; - } - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &callback) == FAILURE) { return; } -- 2.40.0