com php-src: Avoid getThis() usages in zip extension: ext/zip/php_zip.c

From: Date: Thu, 06 Aug 2020 09:28:35 +0000
Subject: com php-src: Avoid getThis() usages in zip extension: ext/zip/php_zip.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-112592@lists.php.net to get a copy of this message
Commit: 84a080ef506c9e8a2d20529a88ff6622ecbecc42 Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 6 Aug 2020 11:28:35 +0200 Parents: ab36540bddb63139c3da9a9da5e5feacdf7bf7bf Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=84a080ef506c9e8a2d20529a88ff6622ecbecc42 Log: Avoid getThis() usages in zip extension There isn't any magic going on here, we can just use ZEND_THIS and assume it exists. Changed paths: M ext/zip/php_zip.c Diff: 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; }

« previous php.cvs (#112592) next »