Skip to content

Commit 49c3ff6

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: Fixes to uri serialization (php#20369)
2 parents 197a455 + afb7b97 commit 49c3ff6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ext/uri/php_uri.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,7 @@ PHP_METHOD(Uri_Rfc3986_Uri, __serialize)
800800
zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &arr);
801801

802802
/* Serialize regular properties: second array */
803-
ZVAL_ARR(&arr, uri_object->std.handlers->get_properties(&uri_object->std));
804-
Z_TRY_ADDREF(arr);
803+
ZVAL_EMPTY_ARRAY(&arr);
805804
zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &arr);
806805
}
807806

@@ -840,7 +839,7 @@ static void uri_unserialize(INTERNAL_FUNCTION_PARAMETERS)
840839
RETURN_THROWS();
841840
}
842841

843-
zval *uri_zv = zend_hash_str_find_ind(Z_ARRVAL_P(arr), ZEND_STRL(PHP_URI_SERIALIZE_URI_FIELD_NAME));
842+
zval *uri_zv = zend_hash_str_find(Z_ARRVAL_P(arr), ZEND_STRL(PHP_URI_SERIALIZE_URI_FIELD_NAME));
844843
if (uri_zv == NULL || Z_TYPE_P(uri_zv) != IS_STRING) {
845844
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(uri_object->std.ce->name));
846845
RETURN_THROWS();
@@ -990,8 +989,7 @@ PHP_METHOD(Uri_WhatWg_Url, __serialize)
990989
zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &arr);
991990

992991
/* Serialize regular properties: second array */
993-
ZVAL_ARR(&arr, this_object->std.handlers->get_properties(&this_object->std));
994-
Z_ADDREF(arr);
992+
ZVAL_EMPTY_ARRAY(&arr);
995993
zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &arr);
996994
}
997995

0 commit comments

Comments
 (0)