File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 35
35
#include "fileinfo_arginfo.h"
36
36
#include "fopen_wrappers.h" /* needed for is_url */
37
37
#include "Zend/zend_exceptions.h"
38
+ #include "Zend/zend_interfaces.h"
38
39
39
40
/* {{{ macros and type definitions */
40
41
typedef struct _php_fileinfo {
@@ -132,8 +133,10 @@ PHP_MINIT_FUNCTION(finfo)
132
133
{
133
134
zend_class_entry _finfo_class_entry ;
134
135
INIT_CLASS_ENTRY (_finfo_class_entry , "finfo" , class_finfo_methods );
135
- _finfo_class_entry .create_object = finfo_objects_new ;
136
136
finfo_class_entry = zend_register_internal_class (& _finfo_class_entry );
137
+ finfo_class_entry -> create_object = finfo_objects_new ;
138
+ finfo_class_entry -> serialize = zend_class_serialize_deny ;
139
+ finfo_class_entry -> unserialize = zend_class_unserialize_deny ;
137
140
138
141
/* copy the standard object handlers to you handler table */
139
142
memcpy (& finfo_object_handlers , & std_object_handlers , sizeof (zend_object_handlers ));
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ try {
14
14
try {
15
15
$ finfo3 = unserialize (serialize ($ finfo ));
16
16
var_dump ($ finfo3 ->buffer ("Test string " ));
17
- } catch (Error $ e ) {
17
+ } catch (Exception $ e ) {
18
18
echo $ e ->getMessage (), "\n" ;
19
19
}
20
20
21
21
?>
22
22
--EXPECTF--
23
23
string(%d) "%s"
24
24
Trying to clone an uncloneable object of class finfo
25
- Invalid finfo object
25
+ Serialization of ' finfo' is not allowed
You can’t perform that action at this time.
0 commit comments