@@ -1094,6 +1094,13 @@ PHPAPI zend_object *php_uri_object_handler_clone(zend_object *object)
10941094 return & new_uri_object -> std ;
10951095}
10961096
1097+ PHPAPI int php_uri_object_handler_unserialize (zval * object , zend_class_entry * ce , const unsigned char * buf , size_t buf_len , zend_unserialize_data * data )
1098+ {
1099+ zend_throw_exception_ex (NULL , 0 , "Unserialization of %s using the \"C\" format is unsupported" , ZSTR_VAL (ce -> name ));
1100+
1101+ return FAILURE ;
1102+ }
1103+
10971104PHPAPI zend_result php_uri_parser_register (const php_uri_parser * uri_parser )
10981105{
10991106 zend_string * key = zend_string_init_interned (uri_parser -> name , strlen (uri_parser -> name ), true);
@@ -1116,6 +1123,7 @@ static PHP_MINIT_FUNCTION(uri)
11161123 php_uri_ce_rfc3986_uri = register_class_Uri_Rfc3986_Uri ();
11171124 php_uri_ce_rfc3986_uri -> create_object = php_uri_object_create_rfc3986 ;
11181125 php_uri_ce_rfc3986_uri -> default_object_handlers = & object_handlers_rfc3986_uri ;
1126+ php_uri_ce_rfc3986_uri -> unserialize = & php_uri_object_handler_unserialize ;
11191127 memcpy (& object_handlers_rfc3986_uri , zend_get_std_object_handlers (), sizeof (zend_object_handlers ));
11201128 object_handlers_rfc3986_uri .offset = offsetof(php_uri_object , std );
11211129 object_handlers_rfc3986_uri .free_obj = php_uri_object_handler_free ;
@@ -1127,6 +1135,7 @@ static PHP_MINIT_FUNCTION(uri)
11271135 php_uri_ce_whatwg_url = register_class_Uri_WhatWg_Url ();
11281136 php_uri_ce_whatwg_url -> create_object = php_uri_object_create_whatwg ;
11291137 php_uri_ce_whatwg_url -> default_object_handlers = & object_handlers_whatwg_uri ;
1138+ php_uri_ce_whatwg_url -> unserialize = & php_uri_object_handler_unserialize ;
11301139 memcpy (& object_handlers_whatwg_uri , zend_get_std_object_handlers (), sizeof (zend_object_handlers ));
11311140 object_handlers_whatwg_uri .offset = offsetof(php_uri_object , std );
11321141 object_handlers_whatwg_uri .free_obj = php_uri_object_handler_free ;
@@ -1136,6 +1145,7 @@ static PHP_MINIT_FUNCTION(uri)
11361145 php_uri_ce_exception = register_class_Uri_UriException (zend_ce_exception );
11371146 php_uri_ce_error = register_class_Uri_UriError (zend_ce_error );
11381147 php_uri_ce_invalid_uri_exception = register_class_Uri_InvalidUriException (php_uri_ce_exception );
1148+ php_uri_ce_invalid_uri_exception -> unserialize = & php_uri_object_handler_unserialize ;
11391149 php_uri_ce_whatwg_invalid_url_exception = register_class_Uri_WhatWg_InvalidUrlException (php_uri_ce_invalid_uri_exception );
11401150 php_uri_ce_whatwg_url_host_type = register_class_Uri_WhatWg_UrlHostType ();
11411151 php_uri_ce_whatwg_url_validation_error = register_class_Uri_WhatWg_UrlValidationError ();
0 commit comments