summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2021-03-17 11:50:54 +0000
committerGeorge Peter Banyard <girgias@php.net>2021-03-17 16:36:23 +0000
commita6fc427b8c51015c16541c112a26dd06bd75e99e (patch)
treedbd3e06f6ec15e02410b6a021b84a5a5abd56301 /ext
parenta74e248c43a7aa42af27d6696887a9fede2a3a0a (diff)
downloadphp-git-a6fc427b8c51015c16541c112a26dd06bd75e99e.tar.gz
Use zend_string_equals() API instead of strcmp() in various places
Closes GH-6784
Diffstat (limited to 'ext')
-rw-r--r--ext/gd/gd.c2
-rw-r--r--ext/standard/string.c2
-rw-r--r--ext/xml/xml.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index fe672a1aee..609a61ebc2 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -3182,7 +3182,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (key == NULL) {
continue;
}
- if (strcmp("linespacing", ZSTR_VAL(key)) == 0) {
+ if (zend_string_equals_literal(key, "linespacing")) {
strex.flags |= gdFTEX_LINESPACE;
strex.linespacing = zval_get_double(item);
}
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 2cab70c82f..6414ec60cf 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4634,7 +4634,7 @@ PHP_FUNCTION(strip_tags)
static zend_string *try_setlocale_str(zend_long cat, zend_string *loc) {
const char *retval;
- if (!strcmp("0", ZSTR_VAL(loc))) {
+ if (zend_string_equals_literal(loc, "0")) {
loc = NULL;
} else {
if (ZSTR_LEN(loc) >= 255) {
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 4079a280ff..3f7a81e6f0 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -813,7 +813,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
ZEND_HASH_REVERSE_FOREACH_VAL(Z_ARRVAL(parser->data), curtag) {
if ((mytype = zend_hash_str_find(Z_ARRVAL_P(curtag),"type", sizeof("type") - 1))) {
- if (!strcmp(Z_STRVAL_P(mytype), "cdata")) {
+ if (zend_string_equals_literal(Z_STR_P(mytype), "cdata")) {
if ((myval = zend_hash_str_find(Z_ARRVAL_P(curtag), "value", sizeof("value") - 1))) {
int newlen = Z_STRLEN_P(myval) + ZSTR_LEN(decoded_value);
Z_STR_P(myval) = zend_string_extend(Z_STR_P(myval), newlen, 0);