22
22
23
23
#include "php.h"
24
24
#include "Zend/zend_exceptions.h"
25
+ #include "Zend/zend_interfaces.h"
25
26
#include "php_curl.h"
26
27
#if HAVE_CURL
27
28
@@ -130,16 +131,6 @@ ZEND_METHOD(CURLFile, setPostFilename)
130
131
}
131
132
/* }}} */
132
133
133
- /* {{{ proto CURLFile::__wakeup()
134
- Unserialization handler */
135
- ZEND_METHOD (CURLFile , __wakeup )
136
- {
137
- zend_unset_property (curl_CURLFile_class , ZEND_THIS , "name" , sizeof ("name" )- 1 );
138
- zend_update_property_string (curl_CURLFile_class , ZEND_THIS , "name" , sizeof ("name" )- 1 , "" );
139
- zend_throw_exception (NULL , "Unserialization of CURLFile instances is not allowed" , 0 );
140
- }
141
- /* }}} */
142
-
143
134
ZEND_BEGIN_ARG_INFO_EX (arginfo_curlfile_create , 0 , 0 , 1 )
144
135
ZEND_ARG_INFO (0 , filename )
145
136
ZEND_ARG_INFO (0 , mimetype )
@@ -158,7 +149,6 @@ static const zend_function_entry curlfile_funcs[] = {
158
149
PHP_ME (CURLFile , setMimeType , arginfo_curlfile_name , ZEND_ACC_PUBLIC )
159
150
PHP_ME (CURLFile , getPostFilename , NULL , ZEND_ACC_PUBLIC )
160
151
PHP_ME (CURLFile , setPostFilename , arginfo_curlfile_name , ZEND_ACC_PUBLIC )
161
- PHP_ME (CURLFile , __wakeup , NULL , ZEND_ACC_PUBLIC )
162
152
PHP_FE_END
163
153
};
164
154
@@ -167,6 +157,8 @@ void curlfile_register_class(void)
167
157
zend_class_entry ce ;
168
158
INIT_CLASS_ENTRY ( ce , "CURLFile" , curlfile_funcs );
169
159
curl_CURLFile_class = zend_register_internal_class (& ce );
160
+ curl_CURLFile_class -> serialize = zend_class_serialize_deny ;
161
+ curl_CURLFile_class -> unserialize = zend_class_unserialize_deny ;
170
162
zend_declare_property_string (curl_CURLFile_class , "name" , sizeof ("name" )- 1 , "" , ZEND_ACC_PUBLIC );
171
163
zend_declare_property_string (curl_CURLFile_class , "mime" , sizeof ("mime" )- 1 , "" , ZEND_ACC_PUBLIC );
172
164
zend_declare_property_string (curl_CURLFile_class , "postname" , sizeof ("postname" )- 1 , "" , ZEND_ACC_PUBLIC );
0 commit comments