closes #37: avoid crash storing object. raise error instead
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@971 c26eb9a1-5813-0410-bd6c-c2e55f420ca73.0
parent
7b26529670
commit
96ab621853
5
xcache.c
5
xcache.c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue