mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Use zend_string_equals() API instead of strcmp() in various places
Closes GH-6784
This commit is contained in:
parent
a74e248c43
commit
a6fc427b8c
4 changed files with 4 additions and 4 deletions
|
@ -7902,7 +7902,7 @@ static bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
|
||||||
ZSTR_LEN(dirname) = zend_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
|
ZSTR_LEN(dirname) = zend_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (strcmp(ZSTR_VAL(dirname), ".") == 0) {
|
if (zend_string_equals_literal(dirname, ".")) {
|
||||||
dirname = zend_string_extend(dirname, MAXPATHLEN, 0);
|
dirname = zend_string_extend(dirname, MAXPATHLEN, 0);
|
||||||
#if HAVE_GETCWD
|
#if HAVE_GETCWD
|
||||||
ZEND_IGNORE_VALUE(VCWD_GETCWD(ZSTR_VAL(dirname), MAXPATHLEN));
|
ZEND_IGNORE_VALUE(VCWD_GETCWD(ZSTR_VAL(dirname), MAXPATHLEN));
|
||||||
|
|
|
@ -3182,7 +3182,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||||
if (key == NULL) {
|
if (key == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp("linespacing", ZSTR_VAL(key)) == 0) {
|
if (zend_string_equals_literal(key, "linespacing")) {
|
||||||
strex.flags |= gdFTEX_LINESPACE;
|
strex.flags |= gdFTEX_LINESPACE;
|
||||||
strex.linespacing = zval_get_double(item);
|
strex.linespacing = zval_get_double(item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4634,7 +4634,7 @@ PHP_FUNCTION(strip_tags)
|
||||||
static zend_string *try_setlocale_str(zend_long cat, zend_string *loc) {
|
static zend_string *try_setlocale_str(zend_long cat, zend_string *loc) {
|
||||||
const char *retval;
|
const char *retval;
|
||||||
|
|
||||||
if (!strcmp("0", ZSTR_VAL(loc))) {
|
if (zend_string_equals_literal(loc, "0")) {
|
||||||
loc = NULL;
|
loc = NULL;
|
||||||
} else {
|
} else {
|
||||||
if (ZSTR_LEN(loc) >= 255) {
|
if (ZSTR_LEN(loc) >= 255) {
|
||||||
|
|
|
@ -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) {
|
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 ((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))) {
|
if ((myval = zend_hash_str_find(Z_ARRVAL_P(curtag), "value", sizeof("value") - 1))) {
|
||||||
int newlen = Z_STRLEN_P(myval) + ZSTR_LEN(decoded_value);
|
int newlen = Z_STRLEN_P(myval) + ZSTR_LEN(decoded_value);
|
||||||
Z_STR_P(myval) = zend_string_extend(Z_STR_P(myval), newlen, 0);
|
Z_STR_P(myval) = zend_string_extend(Z_STR_P(myval), newlen, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue