Skip to content

Commit a6619f7

Browse files
committed
Fix XML/RPC.php under PHP 8
xml_parser could not be converted to int. The ${var} to {$var} change avoids a depracation warning.
1 parent d3f65a6 commit a6619f7

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

bundled-libs/XML/RPC.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ function parseResponse($data = '')
14331433

14341434
$encoding = $this->getEncoding($data);
14351435
$parser_resource = xml_parser_create($encoding);
1436-
$parser = (int) $parser_resource;
1436+
$parser = 1;
14371437

14381438
$XML_RPC_xh = array();
14391439
$XML_RPC_xh[$parser] = array();
@@ -1590,7 +1590,7 @@ function addScalar($val, $type = 'string')
15901590
}
15911591
$typeof = $GLOBALS['XML_RPC_Types'][$type];
15921592
if ($typeof != 1) {
1593-
$this->raiseError("Not a scalar type (${typeof})",
1593+
$this->raiseError("Not a scalar type ({$typeof})",
15941594
XML_RPC_ERROR_INVALID_TYPE);
15951595
return 0;
15961596
}
@@ -1723,16 +1723,16 @@ function serializedata($typ, $val)
17231723
case 1:
17241724
switch ($typ) {
17251725
case $GLOBALS['XML_RPC_Base64']:
1726-
$rs .= "<${typ}>" . base64_encode($val) . "</${typ}>";
1726+
$rs .= "<{$typ}>" . base64_encode($val) . "</{$typ}>";
17271727
break;
17281728
case $GLOBALS['XML_RPC_Boolean']:
1729-
$rs .= "<${typ}>" . ($val ? '1' : '0') . "</${typ}>";
1729+
$rs .= "<{$typ}>" . ($val ? '1' : '0') . "</{$typ}>";
17301730
break;
17311731
case $GLOBALS['XML_RPC_String']:
1732-
$rs .= "<${typ}>" . serendipity_specialchars($val). "</${typ}>";
1732+
$rs .= "<{$typ}>" . serendipity_specialchars($val). "</{$typ}>";
17331733
break;
17341734
default:
1735-
$rs .= "<${typ}>${val}</${typ}>";
1735+
$rs .= "<{$typ}>{$val}</{$typ}>";
17361736
}
17371737
}
17381738
return $rs;

docs/NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Version 2.6-alpha1 ()
22
------------------------------------------------------------------------
33

4+
* PHP 8 compatibility fixes for bundled XML/RPC.php
5+
46
* Upgrade bundled jQuery to jQuery 3
57

68
* Fix option to set a different theme as fallback option by setting

0 commit comments

Comments
 (0)