mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 09:17:29 +00:00
Use zend_string_equals_* API in a couple of more place
Closes GH-6979
This commit is contained in:
7 files changed
+82
-93
No files matched your search
+8
-8
@@ -603,7 +603,7 @@ int dom_node_prefix_read(dom_object *obj, zval *retval)
|
||||
|
||||
int dom_node_prefix_write(dom_object *obj, zval *newval)
|
||||
{
|
||||
zend_string *str;
|
||||
zend_string *prefix_str;
|
||||
xmlNode *nodep, *nsnode = NULL;
|
||||
xmlNsPtr ns = NULL, curns;
|
||||
char *strURI;
|
||||
@@ -627,17 +627,17 @@ int dom_node_prefix_write(dom_object *obj, zval *newval)
|
||||
nsnode = xmlDocGetRootElement(nodep->doc);
|
||||
}
|
||||
}
|
||||
str = zval_try_get_string(newval);
|
||||
if (UNEXPECTED(!str)) {
|
||||
prefix_str = zval_try_get_string(newval);
|
||||
if (UNEXPECTED(!prefix_str)) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
prefix = ZSTR_VAL(str);
|
||||
prefix = ZSTR_VAL(prefix_str);
|
||||
if (nsnode && nodep->ns != NULL && !xmlStrEqual(nodep->ns->prefix, (xmlChar *)prefix)) {
|
||||
strURI = (char *) nodep->ns->href;
|
||||
if (strURI == NULL ||
|
||||
(!strcmp(prefix, "xml") && strcmp(strURI, (char *) XML_XML_NAMESPACE)) ||
|
||||
(nodep->type == XML_ATTRIBUTE_NODE && !strcmp(prefix, "xmlns") &&
|
||||
(zend_string_equals_literal(prefix_str, "xml") && strcmp(strURI, (char *) XML_XML_NAMESPACE)) ||
|
||||
(nodep->type == XML_ATTRIBUTE_NODE && zend_string_equals_literal(prefix_str, "xmlns") &&
|
||||
strcmp(strURI, (char *) DOM_XMLNS_NAMESPACE)) ||
|
||||
(nodep->type == XML_ATTRIBUTE_NODE && !strcmp((char *) nodep->name, "xmlns"))) {
|
||||
ns = NULL;
|
||||
@@ -656,14 +656,14 @@ int dom_node_prefix_write(dom_object *obj, zval *newval)
|
||||
}
|
||||
|
||||
if (ns == NULL) {
|
||||
zend_string_release_ex(str, 0);
|
||||
zend_string_release_ex(prefix_str, 0);
|
||||
php_dom_throw_error(NAMESPACE_ERR, dom_get_strict_error(obj->document));
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
xmlSetNs(nodep, ns);
|
||||
}
|
||||
zend_string_release_ex(str, 0);
|
||||
zend_string_release_ex(prefix_str, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
+12
-14
@@ -71,19 +71,16 @@ PHP_MINFO_FUNCTION(php_gettext)
|
||||
/* {{{ Set the textdomain to "domain". Returns the current domain */
|
||||
PHP_FUNCTION(textdomain)
|
||||
{
|
||||
char *domain = NULL, *domain_name, *retval;
|
||||
size_t domain_len = 0;
|
||||
char *domain_name = NULL, *retval;
|
||||
zend_string *domain = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", &domain, &domain_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S!", &domain) == FAILURE) {
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
PHP_GETTEXT_DOMAIN_LENGTH_CHECK(1, domain_len)
|
||||
|
||||
if (domain != NULL && strcmp(domain, "") && strcmp(domain, "0")) {
|
||||
domain_name = domain;
|
||||
} else {
|
||||
domain_name = NULL;
|
||||
if (domain != NULL && ZSTR_LEN(domain) != 0 && !zend_string_equals_literal(domain, "0")) {
|
||||
PHP_GETTEXT_DOMAIN_LENGTH_CHECK(1, ZSTR_LEN(domain))
|
||||
domain_name = ZSTR_VAL(domain);
|
||||
}
|
||||
|
||||
retval = textdomain(domain_name);
|
||||
@@ -163,11 +160,12 @@ PHP_FUNCTION(dcgettext)
|
||||
/* {{{ Bind to the text domain domain_name, looking for translations in dir. Returns the current domain */
|
||||
PHP_FUNCTION(bindtextdomain)
|
||||
{
|
||||
char *domain, *dir = NULL;
|
||||
size_t domain_len, dir_len;
|
||||
char *domain;
|
||||
size_t domain_len;
|
||||
zend_string *dir = NULL;
|
||||
char *retval, dir_name[MAXPATHLEN];
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss!", &domain, &domain_len, &dir, &dir_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS!", &domain, &domain_len, &dir) == FAILURE) {
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
@@ -182,8 +180,8 @@ PHP_FUNCTION(bindtextdomain)
|
||||
RETURN_STRING(bindtextdomain(domain, NULL));
|
||||
}
|
||||
|
||||
if (dir[0] != '\0' && strcmp(dir, "0")) {
|
||||
if (!VCWD_REALPATH(dir, dir_name)) {
|
||||
if (ZSTR_LEN(dir) != 0 && !zend_string_equals_literal(dir, "0")) {
|
||||
if (!VCWD_REALPATH(ZSTR_VAL(dir), dir_name)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else if (!VCWD_GETCWD(dir_name, MAXPATHLEN)) {
|
||||
|
||||
@@ -357,7 +357,7 @@ static int php_mb_parse_encoding_array(HashTable *target_hash, const mbfl_encodi
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (strcasecmp(ZSTR_VAL(encoding_str), "auto") == 0) {
|
||||
if (zend_string_equals_literal_ci(encoding_str, "auto")) {
|
||||
if (!included_auto) {
|
||||
const enum mbfl_no_encoding *src = MBSTRG(default_detect_order_list);
|
||||
const size_t identify_list_size = MBSTRG(default_detect_order_list_size);
|
||||
|
||||
+7
-13
@@ -885,22 +885,16 @@ PHP_METHOD(Phar, mungServer)
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
if (Z_STRLEN_P(data) == sizeof("PHP_SELF")-1 && !strncmp(Z_STRVAL_P(data), "PHP_SELF", sizeof("PHP_SELF")-1)) {
|
||||
if (zend_string_equals_literal(Z_STR_P(data), "PHP_SELF")) {
|
||||
PHAR_G(phar_SERVER_mung_list) |= PHAR_MUNG_PHP_SELF;
|
||||
}
|
||||
|
||||
if (Z_STRLEN_P(data) == sizeof("REQUEST_URI")-1) {
|
||||
if (!strncmp(Z_STRVAL_P(data), "REQUEST_URI", sizeof("REQUEST_URI")-1)) {
|
||||
PHAR_G(phar_SERVER_mung_list) |= PHAR_MUNG_REQUEST_URI;
|
||||
}
|
||||
if (!strncmp(Z_STRVAL_P(data), "SCRIPT_NAME", sizeof("SCRIPT_NAME")-1)) {
|
||||
PHAR_G(phar_SERVER_mung_list) |= PHAR_MUNG_SCRIPT_NAME;
|
||||
}
|
||||
}
|
||||
|
||||
if (Z_STRLEN_P(data) == sizeof("SCRIPT_FILENAME")-1 && !strncmp(Z_STRVAL_P(data), "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME")-1)) {
|
||||
} else if (zend_string_equals_literal(Z_STR_P(data), "REQUEST_URI")) {
|
||||
PHAR_G(phar_SERVER_mung_list) |= PHAR_MUNG_REQUEST_URI;
|
||||
} else if (zend_string_equals_literal(Z_STR_P(data), "SCRIPT_NAME")) {
|
||||
PHAR_G(phar_SERVER_mung_list) |= PHAR_MUNG_SCRIPT_NAME;
|
||||
} else if (zend_string_equals_literal(Z_STR_P(data), "SCRIPT_FILENAME")) {
|
||||
PHAR_G(phar_SERVER_mung_list) |= PHAR_MUNG_SCRIPT_FILENAME;
|
||||
}
|
||||
// TODO Warning for invalid value?
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+5
-9
@@ -731,23 +731,19 @@ static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht) /* {{{ */
|
||||
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(ht2, name, tmp) {
|
||||
if (name) {
|
||||
if (ZSTR_LEN(name) == sizeof("type_name")-1 &&
|
||||
strncmp(ZSTR_VAL(name), "type_name", sizeof("type_name")-1) == 0) {
|
||||
if (zend_string_equals_literal(name, "type_name")) {
|
||||
if (Z_TYPE_P(tmp) == IS_STRING) {
|
||||
type_name = Z_STRVAL_P(tmp);
|
||||
} else if (Z_TYPE_P(tmp) != IS_NULL) {
|
||||
}
|
||||
} else if (ZSTR_LEN(name) == sizeof("type_ns")-1 &&
|
||||
strncmp(ZSTR_VAL(name), "type_ns", sizeof("type_ns")-1) == 0) {
|
||||
} else if (zend_string_equals_literal(name, "type_ns")) {
|
||||
if (Z_TYPE_P(tmp) == IS_STRING) {
|
||||
type_ns = Z_STRVAL_P(tmp);
|
||||
} else if (Z_TYPE_P(tmp) != IS_NULL) {
|
||||
}
|
||||
} else if (ZSTR_LEN(name) == sizeof("to_xml")-1 &&
|
||||
strncmp(ZSTR_VAL(name), "to_xml", sizeof("to_xml")-1) == 0) {
|
||||
} else if (zend_string_equals_literal(name, "to_xml")) {
|
||||
to_xml = tmp;
|
||||
} else if (ZSTR_LEN(name) == sizeof("from_xml")-1 &&
|
||||
strncmp(ZSTR_VAL(name), "from_xml", sizeof("from_xml")-1) == 0) {
|
||||
} else if (zend_string_equals_literal(name, "from_xml")) {
|
||||
to_zval = tmp;
|
||||
}
|
||||
}
|
||||
@@ -1756,7 +1752,7 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
|
||||
if ((Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY || zend_is_auto_global(ZSTR_KNOWN(ZEND_STR_AUTOGLOBAL_SERVER))) &&
|
||||
(agent_name = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT")-1)) != NULL &&
|
||||
Z_TYPE_P(agent_name) == IS_STRING) {
|
||||
if (strncmp(Z_STRVAL_P(agent_name), "Shockwave Flash", sizeof("Shockwave Flash")-1) == 0) {
|
||||
if (zend_string_equals_literal(Z_STR_P(agent_name), "Shockwave Flash")) {
|
||||
use_http_error_status = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2246,12 +2246,13 @@ PHP_FUNCTION(ignore_user_abort)
|
||||
/* {{{ Returns port associated with service. Protocol must be "tcp" or "udp" */
|
||||
PHP_FUNCTION(getservbyname)
|
||||
{
|
||||
char *name, *proto;
|
||||
size_t name_len, proto_len;
|
||||
zend_string *name;
|
||||
char *proto;
|
||||
size_t proto_len;
|
||||
struct servent *serv;
|
||||
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_STRING(name, name_len)
|
||||
Z_PARAM_STR(name)
|
||||
Z_PARAM_STRING(proto, proto_len)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
@@ -2264,14 +2265,14 @@ PHP_FUNCTION(getservbyname)
|
||||
}
|
||||
#endif
|
||||
|
||||
serv = getservbyname(name, proto);
|
||||
serv = getservbyname(ZSTR_VAL(name), proto);
|
||||
|
||||
#if defined(_AIX)
|
||||
/*
|
||||
On AIX, imap is only known as imap2 in /etc/services, while on Linux imap is an alias for imap2.
|
||||
If a request for imap gives no result, we try again with imap2.
|
||||
*/
|
||||
if (serv == NULL && strcmp(name, "imap") == 0) {
|
||||
if (serv == NULL && zend_string_equals_literal(name, "imap")) {
|
||||
serv = getservbyname("imap2", proto);
|
||||
}
|
||||
#endif
|
||||
|
||||
+43
-43
@@ -208,9 +208,9 @@ static int fpm_conf_expand_pool_name(char **value) {
|
||||
|
||||
static char *fpm_conf_set_boolean(zval *value, void **config, intptr_t offset) /* {{{ */
|
||||
{
|
||||
char *val = Z_STRVAL_P(value);
|
||||
long value_y = !strcasecmp(val, "1");
|
||||
long value_n = !strcasecmp(val, "");
|
||||
zend_string *val = Z_STR_P(value);
|
||||
bool value_y = zend_string_equals_literal(val, "1");
|
||||
bool value_n = ZSTR_LEN(val) == 0; /* Empty string is the only valid false value */
|
||||
|
||||
if (!value_y && !value_n) {
|
||||
return "invalid boolean value";
|
||||
@@ -324,18 +324,18 @@ static char *fpm_conf_set_time(zval *value, void **config, intptr_t offset) /* {
|
||||
|
||||
static char *fpm_conf_set_log_level(zval *value, void **config, intptr_t offset) /* {{{ */
|
||||
{
|
||||
char *val = Z_STRVAL_P(value);
|
||||
zend_string *val = Z_STR_P(value);
|
||||
int log_level;
|
||||
|
||||
if (!strcasecmp(val, "debug")) {
|
||||
if (zend_string_equals_literal_ci(val, "debug")) {
|
||||
log_level = ZLOG_DEBUG;
|
||||
} else if (!strcasecmp(val, "notice")) {
|
||||
} else if (zend_string_equals_literal_ci(val, "notice")) {
|
||||
log_level = ZLOG_NOTICE;
|
||||
} else if (!strcasecmp(val, "warning") || !strcasecmp(val, "warn")) {
|
||||
} else if (zend_string_equals_literal_ci(val, "warning") || zend_string_equals_literal_ci(val, "warn")) {
|
||||
log_level = ZLOG_WARNING;
|
||||
} else if (!strcasecmp(val, "error")) {
|
||||
} else if (zend_string_equals_literal_ci(val, "error")) {
|
||||
log_level = ZLOG_ERROR;
|
||||
} else if (!strcasecmp(val, "alert")) {
|
||||
} else if (zend_string_equals_literal_ci(val, "alert")) {
|
||||
log_level = ZLOG_ALERT;
|
||||
} else {
|
||||
return "invalid value for 'log_level'";
|
||||
@@ -349,144 +349,144 @@ static char *fpm_conf_set_log_level(zval *value, void **config, intptr_t offset)
|
||||
#ifdef HAVE_SYSLOG_H
|
||||
static char *fpm_conf_set_syslog_facility(zval *value, void **config, intptr_t offset) /* {{{ */
|
||||
{
|
||||
char *val = Z_STRVAL_P(value);
|
||||
zend_string *val = Z_STR_P(value);
|
||||
int *conf = (int *) ((char *) *config + offset);
|
||||
|
||||
#ifdef LOG_AUTH
|
||||
if (!strcasecmp(val, "AUTH")) {
|
||||
if (zend_string_equals_literal_ci(val, "AUTH")) {
|
||||
*conf = LOG_AUTH;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_AUTHPRIV
|
||||
if (!strcasecmp(val, "AUTHPRIV")) {
|
||||
if (zend_string_equals_literal_ci(val, "AUTHPRIV")) {
|
||||
*conf = LOG_AUTHPRIV;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_CRON
|
||||
if (!strcasecmp(val, "CRON")) {
|
||||
if (zend_string_equals_literal_ci(val, "CRON")) {
|
||||
*conf = LOG_CRON;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_DAEMON
|
||||
if (!strcasecmp(val, "DAEMON")) {
|
||||
if (zend_string_equals_literal_ci(val, "DAEMON")) {
|
||||
*conf = LOG_DAEMON;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_FTP
|
||||
if (!strcasecmp(val, "FTP")) {
|
||||
if (zend_string_equals_literal_ci(val, "FTP")) {
|
||||
*conf = LOG_FTP;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_KERN
|
||||
if (!strcasecmp(val, "KERN")) {
|
||||
if (zend_string_equals_literal_ci(val, "KERN")) {
|
||||
*conf = LOG_KERN;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_LPR
|
||||
if (!strcasecmp(val, "LPR")) {
|
||||
if (zend_string_equals_literal_ci(val, "LPR")) {
|
||||
*conf = LOG_LPR;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_MAIL
|
||||
if (!strcasecmp(val, "MAIL")) {
|
||||
if (zend_string_equals_literal_ci(val, "MAIL")) {
|
||||
*conf = LOG_MAIL;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_NEWS
|
||||
if (!strcasecmp(val, "NEWS")) {
|
||||
if (zend_string_equals_literal_ci(val, "NEWS")) {
|
||||
*conf = LOG_NEWS;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_SYSLOG
|
||||
if (!strcasecmp(val, "SYSLOG")) {
|
||||
if (zend_string_equals_literal_ci(val, "SYSLOG")) {
|
||||
*conf = LOG_SYSLOG;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_USER
|
||||
if (!strcasecmp(val, "USER")) {
|
||||
if (zend_string_equals_literal_ci(val, "USER")) {
|
||||
*conf = LOG_USER;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_UUCP
|
||||
if (!strcasecmp(val, "UUCP")) {
|
||||
if (zend_string_equals_literal_ci(val, "UUCP")) {
|
||||
*conf = LOG_UUCP;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_LOCAL0
|
||||
if (!strcasecmp(val, "LOCAL0")) {
|
||||
if (zend_string_equals_literal_ci(val, "LOCAL0")) {
|
||||
*conf = LOG_LOCAL0;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_LOCAL1
|
||||
if (!strcasecmp(val, "LOCAL1")) {
|
||||
if (zend_string_equals_literal_ci(val, "LOCAL1")) {
|
||||
*conf = LOG_LOCAL1;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_LOCAL2
|
||||
if (!strcasecmp(val, "LOCAL2")) {
|
||||
if (zend_string_equals_literal_ci(val, "LOCAL2")) {
|
||||
*conf = LOG_LOCAL2;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_LOCAL3
|
||||
if (!strcasecmp(val, "LOCAL3")) {
|
||||
if (zend_string_equals_literal_ci(val, "LOCAL3")) {
|
||||
*conf = LOG_LOCAL3;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_LOCAL4
|
||||
if (!strcasecmp(val, "LOCAL4")) {
|
||||
if (zend_string_equals_literal_ci(val, "LOCAL4")) {
|
||||
*conf = LOG_LOCAL4;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_LOCAL5
|
||||
if (!strcasecmp(val, "LOCAL5")) {
|
||||
if (zend_string_equals_literal_ci(val, "LOCAL5")) {
|
||||
*conf = LOG_LOCAL5;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_LOCAL6
|
||||
if (!strcasecmp(val, "LOCAL6")) {
|
||||
if (zend_string_equals_literal_ci(val, "LOCAL6")) {
|
||||
*conf = LOG_LOCAL6;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOG_LOCAL7
|
||||
if (!strcasecmp(val, "LOCAL7")) {
|
||||
if (zend_string_equals_literal_ci(val, "LOCAL7")) {
|
||||
*conf = LOG_LOCAL7;
|
||||
return NULL;
|
||||
}
|
||||
@@ -499,10 +499,10 @@ static char *fpm_conf_set_syslog_facility(zval *value, void **config, intptr_t o
|
||||
|
||||
static char *fpm_conf_set_rlimit_core(zval *value, void **config, intptr_t offset) /* {{{ */
|
||||
{
|
||||
char *val = Z_STRVAL_P(value);
|
||||
zend_string *val = Z_STR_P(value);
|
||||
int *ptr = (int *) ((char *) *config + offset);
|
||||
|
||||
if (!strcasecmp(val, "unlimited")) {
|
||||
if (zend_string_equals_literal_ci(val, "unlimited")) {
|
||||
*ptr = -1;
|
||||
} else {
|
||||
int int_value;
|
||||
@@ -528,13 +528,13 @@ static char *fpm_conf_set_rlimit_core(zval *value, void **config, intptr_t offse
|
||||
|
||||
static char *fpm_conf_set_pm(zval *value, void **config, intptr_t offset) /* {{{ */
|
||||
{
|
||||
char *val = Z_STRVAL_P(value);
|
||||
zend_string *val = Z_STR_P(value);
|
||||
struct fpm_worker_pool_config_s *c = *config;
|
||||
if (!strcasecmp(val, "static")) {
|
||||
if (zend_string_equals_literal_ci(val, "static")) {
|
||||
c->pm = PM_STYLE_STATIC;
|
||||
} else if (!strcasecmp(val, "dynamic")) {
|
||||
} else if (zend_string_equals_literal_ci(val, "dynamic")) {
|
||||
c->pm = PM_STYLE_DYNAMIC;
|
||||
} else if (!strcasecmp(val, "ondemand")) {
|
||||
} else if (zend_string_equals_literal_ci(val, "ondemand")) {
|
||||
c->pm = PM_STYLE_ONDEMAND;
|
||||
} else {
|
||||
return "invalid process manager (static, dynamic or ondemand)";
|
||||
@@ -1403,7 +1403,7 @@ static void fpm_conf_ini_parser_section(zval *section, void *arg) /* {{{ */
|
||||
int *error = (int *)arg;
|
||||
|
||||
/* switch to global conf */
|
||||
if (!strcasecmp(Z_STRVAL_P(section), "global")) {
|
||||
if (zend_string_equals_literal_ci(Z_STR_P(section), "global")) {
|
||||
current_wp = NULL;
|
||||
return;
|
||||
}
|
||||
@@ -1446,7 +1446,7 @@ static void fpm_conf_ini_parser_entry(zval *name, zval *value, void *arg) /* {{{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmp(Z_STRVAL_P(name), "include")) {
|
||||
if (zend_string_equals_literal(Z_STR_P(name), "include")) {
|
||||
if (ini_include) {
|
||||
zlog(ZLOG_ERROR, "[%s:%d] two includes at the same time !", ini_filename, ini_lineno);
|
||||
*error = 1;
|
||||
@@ -1508,7 +1508,7 @@ static void fpm_conf_ini_parser_array(zval *name, zval *key, zval *value, void *
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmp("env", Z_STRVAL_P(name))) {
|
||||
if (zend_string_equals_literal(Z_STR_P(name), "env")) {
|
||||
if (!*Z_STRVAL_P(value)) {
|
||||
zlog(ZLOG_ERROR, "[%s:%d] empty value", ini_filename, ini_lineno);
|
||||
*error = 1;
|
||||
@@ -1517,19 +1517,19 @@ static void fpm_conf_ini_parser_array(zval *name, zval *key, zval *value, void *
|
||||
config = (char *)current_wp->config + WPO(env);
|
||||
err = fpm_conf_set_array(key, value, &config, 0);
|
||||
|
||||
} else if (!strcmp("php_value", Z_STRVAL_P(name))) {
|
||||
} else if (zend_string_equals_literal(Z_STR_P(name), "php_value")) {
|
||||
config = (char *)current_wp->config + WPO(php_values);
|
||||
err = fpm_conf_set_array(key, value, &config, 0);
|
||||
|
||||
} else if (!strcmp("php_admin_value", Z_STRVAL_P(name))) {
|
||||
} else if (zend_string_equals_literal(Z_STR_P(name), "php_admin_value")) {
|
||||
config = (char *)current_wp->config + WPO(php_admin_values);
|
||||
err = fpm_conf_set_array(key, value, &config, 0);
|
||||
|
||||
} else if (!strcmp("php_flag", Z_STRVAL_P(name))) {
|
||||
} else if (zend_string_equals_literal(Z_STR_P(name), "php_flag")) {
|
||||
config = (char *)current_wp->config + WPO(php_values);
|
||||
err = fpm_conf_set_array(key, value, &config, 1);
|
||||
|
||||
} else if (!strcmp("php_admin_flag", Z_STRVAL_P(name))) {
|
||||
} else if (zend_string_equals_literal(Z_STR_P(name), "php_admin_flag")) {
|
||||
config = (char *)current_wp->config + WPO(php_admin_values);
|
||||
err = fpm_conf_set_array(key, value, &config, 1);
|
||||
|
||||
|
||||
Reference in new issue
Block a user