diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 90f0e1099619b..b58c9c0c578c7 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 69e9dae3fa990..73391b0f7a85d 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 0e9e77bef88eb..6ab6ebd378fda 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -254,11 +254,12 @@ 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] == '{') { 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 05a37bd1b9a33..77aa83b346edb 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; }