@@ -245,7 +245,7 @@ function XML_RPC_se($parser_resource, $name, $attrs)
245
245
{
246
246
global $ XML_RPC_xh , $ XML_RPC_valid_parents ;
247
247
248
- $ parser = spl_object_hash ($ parser_resource );
248
+ $ parser = is_resource ( $ parser_resource ) ? (( int ) $ parser_resource ) : spl_object_hash ($ parser_resource );
249
249
250
250
// if invalid xmlrpc already detected, skip all processing
251
251
if ($ XML_RPC_xh [$ parser ]['isf ' ] >= 2 ) {
@@ -374,7 +374,7 @@ function XML_RPC_ee($parser_resource, $name)
374
374
{
375
375
global $ XML_RPC_xh ;
376
376
377
- $ parser = spl_object_hash ($ parser_resource );
377
+ $ parser = is_resource ( $ parser_resource ) ? (( int ) $ parser_resource ) : spl_object_hash ($ parser_resource );
378
378
379
379
if ($ XML_RPC_xh [$ parser ]['isf ' ] >= 2 ) {
380
380
return ;
@@ -511,7 +511,7 @@ function XML_RPC_cd($parser_resource, $data)
511
511
{
512
512
global $ XML_RPC_xh , $ XML_RPC_backslash ;
513
513
514
- $ parser = spl_object_hash ($ parser_resource );
514
+ $ parser = is_resource ( $ parser_resource ) ? (( int ) $ parser_resource ) : spl_object_hash ($ parser_resource );
515
515
516
516
if ($ XML_RPC_xh [$ parser ]['lv ' ] != 3 ) {
517
517
// "lookforvalue==3" means that we've found an entire value
@@ -1433,7 +1433,9 @@ function parseResponse($data = '')
1433
1433
1434
1434
$ encoding = $ this ->getEncoding ($ data );
1435
1435
$ parser_resource = xml_parser_create ($ encoding );
1436
- $ parser = spl_object_hash ($ parser_resource );
1436
+ # xml_parser_create returns a resource before PHP 8, an object later. Only a resource can be
1437
+ # casted to int
1438
+ $ parser = is_resource ($ parser_resource ) ? ((int ) $ parser_resource ) : spl_object_hash ($ parser_resource );
1437
1439
1438
1440
$ XML_RPC_xh = array ();
1439
1441
$ XML_RPC_xh [$ parser ] = array ();
0 commit comments