1
0
Fork 0

closes #37: avoid crash storing object. raise error instead

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@971 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
Xuefer 2012-07-14 02:34:31 +00:00
parent 7b26529670
commit 96ab621853
1 changed files with 5 additions and 0 deletions

View File

@ -2891,6 +2891,11 @@ PHP_FUNCTION(xcache_set)
return;
}
if (Z_TYPE_P(value) == IS_OBJECT) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Objects cannot be stored in the variable cache. Use serialize before xcache_set");
RETURN_NULL();
}
/* max ttl */
if (xc_var_maxttl && (!entry_var.entry.ttl || entry_var.entry.ttl > xc_var_maxttl)) {
entry_var.entry.ttl = xc_var_maxttl;