Skip to content

Commit 84a080e

Browse files
committed
Avoid getThis() usages in zip extension
There isn't any magic going on here, we can just use ZEND_THIS and assume it exists.
1 parent ab36540 commit 84a080e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

ext/zip/php_zip.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,15 +2884,11 @@ static void _php_zip_progress_callback(zip_t *arch, double state, void *ptr)
28842884
PHP_METHOD(ZipArchive, registerProgressCallback)
28852885
{
28862886
struct zip *intern;
2887-
zval *self = getThis();
2887+
zval *self = ZEND_THIS;
28882888
double rate;
28892889
zval *callback;
28902890
ze_zip_object *obj;
28912891

2892-
if (!self) {
2893-
RETURN_FALSE;
2894-
}
2895-
28962892
if (zend_parse_parameters(ZEND_NUM_ARGS(), "dz", &rate, &callback) == FAILURE) {
28972893
return;
28982894
}
@@ -2942,14 +2938,10 @@ static int _php_zip_cancel_callback(zip_t *arch, void *ptr)
29422938
PHP_METHOD(ZipArchive, registerCancelCallback)
29432939
{
29442940
struct zip *intern;
2945-
zval *self = getThis();
2941+
zval *self = ZEND_THIS;
29462942
zval *callback;
29472943
ze_zip_object *obj;
29482944

2949-
if (!self) {
2950-
RETURN_FALSE;
2951-
}
2952-
29532945
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &callback) == FAILURE) {
29542946
return;
29552947
}

0 commit comments

Comments
 (0)