mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Fixed bug #17281
This commit is contained in:
parent
1142e16075
commit
2af630f87d
1 changed files with 9 additions and 0 deletions
|
@ -463,6 +463,11 @@ static char *php_session_encode(int *newlen TSRMLS_DC)
|
|||
{
|
||||
char *ret = NULL;
|
||||
|
||||
if (!PS(http_session_vars)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot encode non-existent session.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (PS(serializer)->encode(&ret, newlen TSRMLS_CC) == FAILURE)
|
||||
ret = NULL;
|
||||
|
||||
|
@ -1318,6 +1323,10 @@ PHP_FUNCTION(session_encode)
|
|||
}
|
||||
|
||||
enc = php_session_encode(&len TSRMLS_CC);
|
||||
if (enc == NULL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
RETVAL_STRINGL(enc, len, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue