#include "fileinfo_arginfo.h"
#include "fopen_wrappers.h" /* needed for is_url */
#include "Zend/zend_exceptions.h"
+#include "Zend/zend_interfaces.h"
/* {{{ macros and type definitions */
typedef struct _php_fileinfo {
{
zend_class_entry _finfo_class_entry;
INIT_CLASS_ENTRY(_finfo_class_entry, "finfo", class_finfo_methods);
- _finfo_class_entry.create_object = finfo_objects_new;
finfo_class_entry = zend_register_internal_class(&_finfo_class_entry);
+ finfo_class_entry->create_object = finfo_objects_new;
+ finfo_class_entry->serialize = zend_class_serialize_deny;
+ finfo_class_entry->unserialize = zend_class_unserialize_deny;
/* copy the standard object handlers to you handler table */
memcpy(&finfo_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
try {
$finfo3 = unserialize(serialize($finfo));
var_dump($finfo3->buffer("Test string"));
-} catch (Error $e) {
+} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
--EXPECTF--
string(%d) "%s"
Trying to clone an uncloneable object of class finfo
-Invalid finfo object
+Serialization of 'finfo' is not allowed