summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/main/main.c b/main/main.c
index 2d58b9c99c..26b2531724 100644
--- a/main/main.c
+++ b/main/main.c
@@ -130,7 +130,7 @@ static PHP_INI_MH(OnSetPrecision)
{
zend_long i;
- ZEND_ATOL(i, new_value->val);
+ ZEND_ATOL(i, ZSTR_VAL(new_value));
if (i >= 0) {
EG(precision) = i;
return SUCCESS;
@@ -145,7 +145,7 @@ static PHP_INI_MH(OnSetPrecision)
static PHP_INI_MH(OnChangeMemoryLimit)
{
if (new_value) {
- PG(memory_limit) = zend_atol(new_value->val, (int)new_value->len);
+ PG(memory_limit) = zend_atol(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));
} else {
PG(memory_limit) = 1<<30; /* effectively, no limit */
}
@@ -286,11 +286,11 @@ static PHP_INI_MH(OnUpdateTimeout)
{
if (stage==PHP_INI_STAGE_STARTUP) {
/* Don't set a timeout on startup, only per-request */
- ZEND_ATOL(EG(timeout_seconds), new_value->val);
+ ZEND_ATOL(EG(timeout_seconds), ZSTR_VAL(new_value));
return SUCCESS;
}
zend_unset_timeout();
- ZEND_ATOL(EG(timeout_seconds), new_value->val);
+ ZEND_ATOL(EG(timeout_seconds), ZSTR_VAL(new_value));
zend_set_timeout(EG(timeout_seconds), 0);
return SUCCESS;
}
@@ -331,7 +331,7 @@ static int php_get_display_errors_mode(char *value, int value_length)
*/
static PHP_INI_MH(OnUpdateDisplayErrors)
{
- PG(display_errors) = (zend_bool) php_get_display_errors_mode(new_value->val, (int)new_value->len);
+ PG(display_errors) = (zend_bool) php_get_display_errors_mode(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));
return SUCCESS;
}
@@ -345,11 +345,11 @@ static PHP_INI_DISP(display_errors_mode)
char *tmp_value;
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
- tmp_value = (ini_entry->orig_value ? ini_entry->orig_value->val : NULL );
- tmp_value_length = (int)(ini_entry->orig_value? ini_entry->orig_value->len : 0);
+ tmp_value = (ini_entry->orig_value ? ZSTR_VAL(ini_entry->orig_value) : NULL );
+ tmp_value_length = (int)(ini_entry->orig_value? ZSTR_LEN(ini_entry->orig_value) : 0);
} else if (ini_entry->value) {
- tmp_value = ini_entry->value->val;
- tmp_value_length = (int)ini_entry->value->len;
+ tmp_value = ZSTR_VAL(ini_entry->value);
+ tmp_value_length = (int)ZSTR_LEN(ini_entry->value);
} else {
tmp_value = NULL;
tmp_value_length = 0;
@@ -422,8 +422,8 @@ static PHP_INI_MH(OnUpdateOutputEncoding)
static PHP_INI_MH(OnUpdateErrorLog)
{
/* Only do the safemode/open_basedir check at runtime */
- if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value && strcmp(new_value->val, "syslog")) {
- if (PG(open_basedir) && php_check_open_basedir(new_value->val)) {
+ if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value && strcmp(ZSTR_VAL(new_value), "syslog")) {
+ if (PG(open_basedir) && php_check_open_basedir(ZSTR_VAL(new_value))) {
return FAILURE;
}
}
@@ -438,7 +438,7 @@ static PHP_INI_MH(OnUpdateMailLog)
{
/* Only do the safemode/open_basedir check at runtime */
if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value) {
- if (PG(open_basedir) && php_check_open_basedir(new_value->val)) {
+ if (PG(open_basedir) && php_check_open_basedir(ZSTR_VAL(new_value))) {
return FAILURE;
}
}
@@ -645,7 +645,7 @@ PHPAPI void php_log_err(char *log_message)
#else
error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1);
#endif
- len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str->val, log_message, PHP_EOL);
+ len = spprintf(&tmp, 0, "[%s] %s%s", ZSTR_VAL(error_time_str), log_message, PHP_EOL);
#ifdef PHP_WIN32
php_flock(fd, 2);
/* XXX should eventually write in a loop if len > UINT_MAX */
@@ -724,8 +724,8 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
if (PG(html_errors)) {
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, NULL);
efree(buffer);
- buffer = replace_buffer->val;
- buffer_len = (int)replace_buffer->len;
+ buffer = ZSTR_VAL(replace_buffer);
+ buffer_len = (int)ZSTR_LEN(replace_buffer);
}
/* which function caused the problem if any at all */
@@ -783,7 +783,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
if (PG(html_errors)) {
replace_origin = php_escape_html_entities((unsigned char*)origin, origin_len, 0, ENT_COMPAT, NULL);
efree(origin);
- origin = replace_origin->val;
+ origin = ZSTR_VAL(replace_origin);
}
/* origin and buffer available, so lets come up with the error message */
@@ -1098,7 +1098,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
if (PG(html_errors)) {
if (type == E_ERROR || type == E_PARSE) {
zend_string *buf = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, NULL);
- php_printf("%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, buf->val, error_filename, error_lineno, STR_PRINT(append_string));
+ php_printf("%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, ZSTR_VAL(buf), error_filename, error_lineno, STR_PRINT(append_string));
zend_string_free(buf);
} else {
php_printf("%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string));
@@ -2560,10 +2560,10 @@ PHPAPI int php_handle_auth_data(const char *auth)
user = php_base64_decode((const unsigned char*)auth + 6, strlen(auth) - 6);
if (user) {
- pass = strchr(user->val, ':');
+ pass = strchr(ZSTR_VAL(user), ':');
if (pass) {
*pass++ = '\0';
- SG(request_info).auth_user = estrndup(user->val, user->len);
+ SG(request_info).auth_user = estrndup(ZSTR_VAL(user), ZSTR_LEN(user));
SG(request_info).auth_password = estrdup(pass);
ret = 0;
}