summaryrefslogtreecommitdiff
path: root/ext/standard/head.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-25 19:24:55 +0200
committerAnatol Belski <ab@php.net>2014-08-25 19:24:55 +0200
commitc3e3c98ec666812daaaca896cf5ef758a8a6df14 (patch)
treed82a76de5c8d117d1cf2dcca19bb30a283621870 /ext/standard/head.c
parent0cf2dbdf58645b52cb6582b1b2571c5cd9e9e6b3 (diff)
downloadphp-git-c3e3c98ec666812daaaca896cf5ef758a8a6df14.tar.gz
master renames phase 1
Diffstat (limited to 'ext/standard/head.c')
-rw-r--r--ext/standard/head.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/ext/standard/head.c b/ext/standard/head.c
index 928c26293e..b53740563d 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -41,7 +41,7 @@ PHP_FUNCTION(header)
zend_bool rep = 1;
sapi_header_line ctr = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bi", &ctr.line,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &ctr.line,
&ctr.line_len, &rep, &ctr.response_code) == FAILURE)
return;
@@ -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,14 +129,14 @@ 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)));
strlcat(cookie, COOKIE_MAX_AGE, len + 100);
@@ -145,7 +145,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
}
if (encoded_value) {
- STR_FREE(encoded_value);
+ zend_string_free(encoded_value);
}
if (path && path_len > 0) {
@@ -178,11 +178,11 @@ 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;
- php_int_t expires = 0;
+ zend_long expires = 0;
zend_bool secure = 0, httponly = 0;
int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sissbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
@@ -201,11 +201,11 @@ PHP_FUNCTION(setcookie)
PHP_FUNCTION(setrawcookie)
{
char *name, *value = NULL, *path = NULL, *domain = NULL;
- php_int_t expires = 0;
+ zend_long expires = 0;
zend_bool secure = 0, httponly = 0;
int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sissbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
@@ -239,7 +239,7 @@ PHP_FUNCTION(headers_sent)
switch(ZEND_NUM_ARGS()) {
case 2:
zval_dtor(arg2);
- ZVAL_INT(arg2, line);
+ ZVAL_LONG(arg2, line);
case 1:
zval_dtor(arg1);
if (file) {
@@ -289,21 +289,21 @@ PHP_FUNCTION(headers_list)
Sets a response code, or returns the current HTTP response code */
PHP_FUNCTION(http_response_code)
{
- php_int_t response_code = 0;
+ zend_long response_code = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &response_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &response_code) == FAILURE) {
return;
}
if (response_code)
{
- php_int_t 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;
if (old_response_code) {
- RETURN_INT(old_response_code);
+ RETURN_LONG(old_response_code);
}
RETURN_TRUE;
@@ -313,7 +313,7 @@ PHP_FUNCTION(http_response_code)
RETURN_FALSE;
}
- RETURN_INT(SG(sapi_headers).http_response_code);
+ RETURN_LONG(SG(sapi_headers).http_response_code);
}
/* }}} */