summaryrefslogtreecommitdiff
path: root/ext/standard/var_unserializer.re
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/var_unserializer.re')
-rw-r--r--ext/standard/var_unserializer.re7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 1f71bb759d..b3f5d29ca2 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -400,9 +400,12 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
(*p) += 2;
- if (ce->unserialize == NULL) {
+ if (ce->serialize == NULL) {
object_init_ex(*rval, ce);
- } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, elements, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+ } else {
+ /* If this class implements Serializable, it should not land here but in object_custom(). The passed string
+ obviously doesn't descend from the regular serializer. */
+ zend_error(E_WARNING, "Erroneous data format for unserializing '%s'", ce->name);
return 0;
}