mirror of
https://github.com/php/php-src.git
synced 2024-09-27 04:47:22 +00:00
- MFB: snprintf -> slprintf, nuketh extra folding tags, ws fixes
This commit is contained in:
parent
032d54f65c
commit
fec6668d2d
@ -200,7 +200,6 @@ static char *php_session_encode(int *newlen TSRMLS_DC) /* {{{ */
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot encode non-existent session");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
@ -541,6 +540,7 @@ static PHP_INI_MH(OnUpdateSerializer) /* {{{ */
|
||||
|
||||
if (PG(modules_activated) && !tmp) {
|
||||
int err_type;
|
||||
|
||||
if (stage == ZEND_INI_STAGE_RUNTIME) {
|
||||
err_type = E_WARNING;
|
||||
} else {
|
||||
@ -717,7 +717,7 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */
|
||||
zval **tmp;
|
||||
namelen = ((unsigned char)(*p)) & (~PS_BIN_UNDEF);
|
||||
|
||||
if (namelen > PS_BIN_MAX || (p + namelen) >= endptr) {
|
||||
if (namelen < 0 || namelen > PS_BIN_MAX || (p + namelen) >= endptr) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@ -742,7 +742,6 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */
|
||||
zval_ptr_dtor(¤t);
|
||||
}
|
||||
}
|
||||
|
||||
PS_ADD_VARL(name, namelen);
|
||||
efree(name);
|
||||
}
|
||||
@ -799,8 +798,9 @@ PS_SERIALIZER_ENCODE_FUNC(php) /* {{{ */
|
||||
}
|
||||
);
|
||||
|
||||
if (newlen) *newlen = buf.len;
|
||||
|
||||
if (newlen) {
|
||||
*newlen = buf.len;
|
||||
}
|
||||
smart_str_0(&buf);
|
||||
*newstr = buf.c;
|
||||
|
||||
@ -896,10 +896,10 @@ PHPAPI int php_session_register_serializer(
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* *******************
|
||||
* Storage Modules *
|
||||
******************* */
|
||||
@ -965,7 +965,7 @@ static inline void strcpy_gmt(char *ubuf, time_t *when) /* {{{ */
|
||||
return;
|
||||
}
|
||||
|
||||
n = snprintf(buf, sizeof(buf), "%s, %02d %s %d %02d:%02d:%02d GMT", /* SAFE */
|
||||
n = slprintf(buf, sizeof(buf), "%s, %02d %s %d %02d:%02d:%02d GMT", /* SAFE */
|
||||
week_days[tm.tm_wday], tm.tm_mday,
|
||||
month_names[tm.tm_mon], tm.tm_year + 1900,
|
||||
tm.tm_hour, tm.tm_min,
|
||||
@ -1178,7 +1178,6 @@ PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC) /* {{{ */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
@ -1194,7 +1193,6 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
@ -1257,7 +1255,6 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
php_error(E_NOTICE, "A session had already been started - ignoring session_start()");
|
||||
return;
|
||||
} else {
|
||||
@ -1267,7 +1264,6 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
|
||||
|
||||
lensess = strlen(PS(session_name));
|
||||
|
||||
|
||||
/*
|
||||
* Cookies are preferred, because initially
|
||||
* cookie and get variables will be available.
|
||||
@ -1400,7 +1396,7 @@ PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t
|
||||
|
||||
/* {{{ proto void session_set_cookie_params(int lifetime [, string path [, string domain [, bool secure[, bool httponly]]]]) U
|
||||
Set session cookie parameters */
|
||||
static PHP_FUNCTION(session_set_cookie_params) /* {{{ */
|
||||
static PHP_FUNCTION(session_set_cookie_params)
|
||||
{
|
||||
/* lifetime is really a numeric, but the alter_ini_entry method wants a string */
|
||||
char *lifetime, *path = NULL, *domain = NULL;
|
||||
@ -1433,7 +1429,7 @@ static PHP_FUNCTION(session_set_cookie_params) /* {{{ */
|
||||
|
||||
/* {{{ proto array session_get_cookie_params(void) U
|
||||
Return the session cookie parameters */
|
||||
static PHP_FUNCTION(session_get_cookie_params) /* {{{ */
|
||||
static PHP_FUNCTION(session_get_cookie_params)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
@ -1451,7 +1447,7 @@ static PHP_FUNCTION(session_get_cookie_params) /* {{{ */
|
||||
|
||||
/* {{{ proto string session_name([string newname]) U
|
||||
Return the current session name. If newname is given, the session name is replaced with newname */
|
||||
static PHP_FUNCTION(session_name) /* {{{ */
|
||||
static PHP_FUNCTION(session_name)
|
||||
{
|
||||
char *name = NULL;
|
||||
int name_len;
|
||||
@ -1470,7 +1466,7 @@ static PHP_FUNCTION(session_name) /* {{{ */
|
||||
|
||||
/* {{{ proto string session_module_name([string newname]) U
|
||||
Return the current module name used for accessing session data. If newname is given, the module name is replaced with newname */
|
||||
static PHP_FUNCTION(session_module_name) /* {{{ */
|
||||
static PHP_FUNCTION(session_module_name)
|
||||
{
|
||||
char *name = NULL;
|
||||
int name_len;
|
||||
@ -1505,7 +1501,7 @@ static PHP_FUNCTION(session_module_name) /* {{{ */
|
||||
|
||||
/* {{{ proto void session_set_save_handler(string open, string close, string read, string write, string destroy, string gc) U
|
||||
Sets user-level functions */
|
||||
static PHP_FUNCTION(session_set_save_handler) /* {{{ */
|
||||
static PHP_FUNCTION(session_set_save_handler)
|
||||
{
|
||||
zval **args[6];
|
||||
int i;
|
||||
@ -1545,7 +1541,7 @@ static PHP_FUNCTION(session_set_save_handler) /* {{{ */
|
||||
|
||||
/* {{{ proto string session_save_path([string newname]) U
|
||||
Return the current save path passed to module_name. If newname is given, the save path is replaced with newname */
|
||||
static PHP_FUNCTION(session_save_path) /* {{{ */
|
||||
static PHP_FUNCTION(session_save_path)
|
||||
{
|
||||
char *name = NULL;
|
||||
int name_len;
|
||||
|
Loading…
Reference in New Issue
Block a user