From 0fc4914e40909d85f05a7c278da80fc0aecb3579 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Wed, 16 Nov 2022 17:02:42 +0100 Subject: [PATCH] MDL-76334 libraries: upgraded phpxmlrpc to 4.8.1 --- lib/phpxmlrpc/Helper/Date.php | 9 ++------- lib/phpxmlrpc/Helper/XMLParser.php | 2 +- lib/phpxmlrpc/PhpXmlRpc.php | 2 +- lib/phpxmlrpc/Value.php | 8 ++++---- lib/phpxmlrpc/readme_moodle.txt | 2 +- lib/thirdpartylibs.xml | 2 +- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/phpxmlrpc/Helper/Date.php b/lib/phpxmlrpc/Helper/Date.php index bc60cc4869d..a9eb3012d3c 100644 --- a/lib/phpxmlrpc/Helper/Date.php +++ b/lib/phpxmlrpc/Helper/Date.php @@ -23,14 +23,9 @@ class Date public static function iso8601Encode($timet, $utc = 0) { if (!$utc) { - $t = strftime("%Y%m%dT%H:%M:%S", $timet); + $t = date('Ymd\TH:i:s', $timet); } else { - if (function_exists('gmstrftime')) { - // gmstrftime doesn't exist in some versions of PHP - $t = gmstrftime("%Y%m%dT%H:%M:%S", $timet); - } else { - $t = strftime("%Y%m%dT%H:%M:%S", $timet - date('Z')); - } + $t = gmdate('Ymd\TH:i:s', $timet); } return $t; diff --git a/lib/phpxmlrpc/Helper/XMLParser.php b/lib/phpxmlrpc/Helper/XMLParser.php index f6e79a9a0fa..d3595c3a981 100644 --- a/lib/phpxmlrpc/Helper/XMLParser.php +++ b/lib/phpxmlrpc/Helper/XMLParser.php @@ -315,7 +315,7 @@ class XMLParser $this->_xh['ac'] = ''; // reset the accumulator break; } - // we do not support the extension, so + // if here, we do not support the extension, so // drop through intentionally default: // INVALID ELEMENT: RAISE ISF so that it is later recognized!!! diff --git a/lib/phpxmlrpc/PhpXmlRpc.php b/lib/phpxmlrpc/PhpXmlRpc.php index 76ea4cd2742..c7c39eaa3e6 100644 --- a/lib/phpxmlrpc/PhpXmlRpc.php +++ b/lib/phpxmlrpc/PhpXmlRpc.php @@ -80,7 +80,7 @@ class PhpXmlRpc public static $xmlrpc_internalencoding = "UTF-8"; public static $xmlrpcName = "XML-RPC for PHP"; - public static $xmlrpcVersion = "4.8.0"; + public static $xmlrpcVersion = "4.8.1"; // let user errors start at 800 public static $xmlrpcerruser = 800; diff --git a/lib/phpxmlrpc/Value.php b/lib/phpxmlrpc/Value.php index ec43fc140e9..e058957dc6f 100644 --- a/lib/phpxmlrpc/Value.php +++ b/lib/phpxmlrpc/Value.php @@ -262,7 +262,7 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess } /** - * @param string typ + * @param string $typ * @param Value[]|mixed $val * @param string $charsetEncoding * @return string @@ -304,12 +304,12 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess case static::$xmlrpcDateTime: if (is_string($val)) { $rs .= "<${typ}>${val}"; - } elseif (is_a($val, 'DateTime')) { + } elseif (is_a($val, 'DateTime') || is_a($val, 'DateTimeInterface')) { $rs .= "<${typ}>" . $val->format('Ymd\TH:i:s') . ""; } elseif (is_int($val)) { - $rs .= "<${typ}>" . strftime("%Y%m%dT%H:%M:%S", $val) . ""; + $rs .= "<${typ}>" . date('Ymd\TH:i:s', $val) . ""; } else { - // not really a good idea here: but what shall we output anyway? left for backward compat... + // not really a good idea here: but what should we output anyway? left for backward compat... $rs .= "<${typ}>${val}"; } break; diff --git a/lib/phpxmlrpc/readme_moodle.txt b/lib/phpxmlrpc/readme_moodle.txt index 957c0836a72..ae13fbaaebe 100644 --- a/lib/phpxmlrpc/readme_moodle.txt +++ b/lib/phpxmlrpc/readme_moodle.txt @@ -16,7 +16,7 @@ To update: - Edit this file and update the release and commit details below. - Edit lib/thirdpartylibs.xml and update the information details too. -Current version imported: 4.8.0 (39e37ed) +Current version imported: 4.8.1 (c74cc31) Local changes: * readme_moodle.txt - this file ;-) diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml index 460c3569d06..b89e2a30f9d 100644 --- a/lib/thirdpartylibs.xml +++ b/lib/thirdpartylibs.xml @@ -618,7 +618,7 @@ All rights reserved. phpxmlrpc phpxmlrpc A php library for building xml-rpc clients and servers - 4.8.0 + 4.8.1 BSD 3-Clause https://github.com/gggeek/phpxmlrpc