From a4db4b20b0a70e4324f5866ea052cc556c0f0f7c Mon Sep 17 00:00:00 2001 From: lamentxu <1372449351@qq.com> Date: Fri, 10 Apr 2026 18:03:17 +0800 Subject: [PATCH 1/4] refactor --- Zend/zend_object_handlers.c | 2 +- ext/openssl/openssl_pwhash.c | 4 ++-- ext/soap/php_encoding.c | 4 +++- ext/soap/php_http.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 90f0e1099619..b58c9c0c578c 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -563,7 +563,7 @@ ZEND_API zend_result zend_check_property_access(const zend_object *zobj, zend_st if (!(property_info->flags & ZEND_ACC_PRIVATE)) { /* we we're looking for a private prop but found a non private one of the same name */ return FAILURE; - } else if (strcmp(ZSTR_VAL(prop_info_name)+1, ZSTR_VAL(property_info->name)+1)) { + } else if (!zend_string_equals(prop_info_name, property_info->name)) { /* we we're looking for a private prop but found a private one of the same name but another class */ return FAILURE; } diff --git a/ext/openssl/openssl_pwhash.c b/ext/openssl/openssl_pwhash.c index 69e9dae3fa99..73391b0f7a85 100644 --- a/ext/openssl/openssl_pwhash.c +++ b/ext/openssl/openssl_pwhash.c @@ -331,7 +331,7 @@ PHP_FUNCTION(openssl_password_hash) Z_PARAM_ARRAY_HT(options) ZEND_PARSE_PARAMETERS_END(); - if (strcmp(ZSTR_VAL(algo), "argon2i") && strcmp(ZSTR_VAL(algo), "argon2id")) { + if (!zend_string_equals_literal(algo, "argon2i") && !zend_string_equals_literal(algo, "argon2id")) { zend_argument_value_error(1, "must be a valid password openssl hashing algorithm"); RETURN_THROWS(); } @@ -357,7 +357,7 @@ PHP_FUNCTION(openssl_password_verify) Z_PARAM_STR(digest) ZEND_PARSE_PARAMETERS_END(); - if (strcmp(ZSTR_VAL(algo), "argon2i") && strcmp(ZSTR_VAL(algo), "argon2id")) { + if (!zend_string_equals_literal(algo, "argon2i") && !zend_string_equals_literal(algo, "argon2id")) { zend_argument_value_error(1, "must be a valid password openssl hashing algorithm"); RETURN_THROWS(); } diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 0e9e77bef88e..4c3420baeaf3 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -252,13 +252,15 @@ void whiteSpace_collapse(xmlChar* str) static encodePtr find_encoder_by_type_name(sdlPtr sdl, const char *type) { + size_t type_len = strlen(type); + if (sdl && sdl->encoders) { encodePtr enc; ZEND_HASH_FOREACH_PTR(sdl->encoders, enc) { if (type[0] == '{') { if (enc->details.clark_notation - && strcmp(ZSTR_VAL(enc->details.clark_notation), type) == 0) { + && zend_string_equals_cstr(enc->details.clark_notation, type, type_len)) { return enc; } } else { diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 05a37bd1b9a3..77aa83b346ed 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -327,7 +327,7 @@ static bool in_domain(const zend_string *host, const zend_string *domain) { if (ZSTR_VAL(domain)[0] == '.') { if (ZSTR_LEN(host) > ZSTR_LEN(domain)) { - return strcmp(ZSTR_VAL(host)+ZSTR_LEN(host)-ZSTR_LEN(domain), ZSTR_VAL(domain)) == 0; + return zend_string_equals_cstr(domain, ZSTR_VAL(host) + ZSTR_LEN(host) - ZSTR_LEN(domain), ZSTR_LEN(domain)); } else { return false; } From c49b8a58d0ebfe9e9a8f11251ff2faa3a514ed8f Mon Sep 17 00:00:00 2001 From: lamentxu <1372449351@qq.com> Date: Fri, 10 Apr 2026 19:35:11 +0800 Subject: [PATCH 2/4] Update php_encoding.c --- ext/soap/php_encoding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 4c3420baeaf3..7dd0f66ce696 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -252,13 +252,13 @@ void whiteSpace_collapse(xmlChar* str) static encodePtr find_encoder_by_type_name(sdlPtr sdl, const char *type) { - size_t type_len = strlen(type); if (sdl && sdl->encoders) { encodePtr enc; ZEND_HASH_FOREACH_PTR(sdl->encoders, enc) { if (type[0] == '{') { + size_t type_len = strlen(type); if (enc->details.clark_notation && zend_string_equals_cstr(enc->details.clark_notation, type, type_len)) { return enc; From 5e00917db49aa634659b6043fb35f1809ea1e22a Mon Sep 17 00:00:00 2001 From: lamentxu <1372449351@qq.com> Date: Fri, 10 Apr 2026 19:41:58 +0800 Subject: [PATCH 3/4] Update php_encoding.c --- ext/soap/php_encoding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 7dd0f66ce696..c2f8525fbc33 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -255,10 +255,10 @@ static encodePtr find_encoder_by_type_name(sdlPtr sdl, const char *type) if (sdl && sdl->encoders) { encodePtr enc; + size_t type_len = strlen(type); ZEND_HASH_FOREACH_PTR(sdl->encoders, enc) { if (type[0] == '{') { - size_t type_len = strlen(type); if (enc->details.clark_notation && zend_string_equals_cstr(enc->details.clark_notation, type, type_len)) { return enc; From 273d9210c2aa415a1ab0538d11f6c2ecd53505e7 Mon Sep 17 00:00:00 2001 From: lamentxu <1372449351@qq.com> Date: Fri, 10 Apr 2026 19:42:39 +0800 Subject: [PATCH 4/4] Update php_encoding.c --- ext/soap/php_encoding.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index c2f8525fbc33..6ab6ebd378fd 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -252,7 +252,6 @@ void whiteSpace_collapse(xmlChar* str) static encodePtr find_encoder_by_type_name(sdlPtr sdl, const char *type) { - if (sdl && sdl->encoders) { encodePtr enc; size_t type_len = strlen(type);