Skip to content

Commit

Permalink
Bad timestamp in VersionGetCommand::VersionToArray()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dregad committed Sep 6, 2023
1 parent 8fac62f commit 69cc2cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/commands/VersionGetCommand.php
Expand Up @@ -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;
Expand Down

0 comments on commit 69cc2cf

Please sign in to comment.