From 69cc2cfc112c41b9476276a1665820c89de2b9c2 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Wed, 6 Sep 2023 10:06:21 +0200 Subject: [PATCH] Bad timestamp in VersionGetCommand::VersionToArray() Missing ApiObjectFactory::$soap = false initialization causes the version's date_order to be initialized as a XSD_DATETIME SoapVar instead of an ISO-formatted date string as expected. As long as the PHP SOAP Extension is available, this does not cause any actual side effects, because - the return value is not used when the Commands are used from within Mantis Core - REST API initializes ApiObjectFactory::$soap = false so date_order is returned in the correct format. If the SOAP extension is not available, Mantis triggers an internal application error when this function is called. Fixes #32909, #30415 --- core/commands/VersionGetCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/commands/VersionGetCommand.php b/core/commands/VersionGetCommand.php index 01d3a45589..69e215fd85 100644 --- a/core/commands/VersionGetCommand.php +++ b/core/commands/VersionGetCommand.php @@ -164,6 +164,7 @@ public static function VersionToArray( $p_version ) { $t_version['released'] =(bool)$p_version->released; $t_version['obsolete'] = (bool)$p_version->obsolete; + ApiObjectFactory::$soap = false; $t_version['timestamp'] = ApiObjectFactory::datetime( $p_version->date_order ); return $t_version;