diff options
Diffstat (limited to 'ext/standard/head.c')
-rw-r--r-- | ext/standard/head.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ext/standard/head.c b/ext/standard/head.c index ad82b9fbbf..9dae9f8759 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -97,7 +97,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t encoded_value = php_url_encode(value, value_len); len += encoded_value->len; } else if (value) { - encoded_value = STR_INIT(value, value_len, 0); + encoded_value = zend_string_init(value, value_len, 0); len += encoded_value->len; } @@ -118,7 +118,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t */ dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, 1, 0 TSRMLS_CC); snprintf(cookie, len + 100, "Set-Cookie: %s=deleted; expires=%s; Max-Age=0", name, dt->val); - STR_FREE(dt); + zend_string_free(dt); } else { snprintf(cookie, len + 100, "Set-Cookie: %s=%s", name, value ? encoded_value->val : ""); if (expires > 0) { @@ -129,23 +129,23 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t /* check to make sure that the year does not exceed 4 digits in length */ p = zend_memrchr(dt->val, '-', dt->len); if (!p || *(p + 5) != ' ') { - STR_FREE(dt); + zend_string_free(dt); efree(cookie); - STR_FREE(encoded_value); + zend_string_free(encoded_value); zend_error(E_WARNING, "Expiry date cannot have a year greater than 9999"); return FAILURE; } strlcat(cookie, dt->val, len + 100); - STR_FREE(dt); + zend_string_free(dt); - snprintf(tsdelta, sizeof(tsdelta), "%li", (long) difftime(expires, time(NULL))); + snprintf(tsdelta, sizeof(tsdelta), ZEND_LONG_FMT, (zend_long) difftime(expires, time(NULL))); strlcat(cookie, COOKIE_MAX_AGE, len + 100); strlcat(cookie, tsdelta, len + 100); } } if (encoded_value) { - STR_FREE(encoded_value); + zend_string_free(encoded_value); } if (path && path_len > 0) { @@ -178,9 +178,9 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t PHP_FUNCTION(setcookie) { char *name, *value = NULL, *path = NULL, *domain = NULL; - long expires = 0; + zend_long expires = 0; zend_bool secure = 0, httponly = 0; - int name_len, value_len = 0, path_len = 0, domain_len = 0; + size_t name_len, value_len = 0, path_len = 0, domain_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name, &name_len, &value, &value_len, &expires, &path, @@ -201,9 +201,9 @@ PHP_FUNCTION(setcookie) PHP_FUNCTION(setrawcookie) { char *name, *value = NULL, *path = NULL, *domain = NULL; - long expires = 0; + zend_long expires = 0; zend_bool secure = 0, httponly = 0; - int name_len, value_len = 0, path_len = 0, domain_len = 0; + size_t name_len, value_len = 0, path_len = 0, domain_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name, &name_len, &value, &value_len, &expires, &path, @@ -289,7 +289,7 @@ PHP_FUNCTION(headers_list) Sets a response code, or returns the current HTTP response code */ PHP_FUNCTION(http_response_code) { - long response_code = 0; + zend_long response_code = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &response_code) == FAILURE) { return; @@ -297,7 +297,7 @@ PHP_FUNCTION(http_response_code) if (response_code) { - long old_response_code; + zend_long old_response_code; old_response_code = SG(sapi_headers).http_response_code; SG(sapi_headers).http_response_code = response_code; |