From 708fb7a27105c19d3623f8b8b8c3929fbcd3d4c5 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 29 Sep 2020 17:03:48 +1300 Subject: [PATCH] dev/core#2073 just tweak a memory leak This one is like https://github.com/civicrm/civicrm-core/pull/18632 but only seems to have switched us from an xml leakage to a string leakage - it still seems slightly better from a code quality point of view --- CRM/Core/CodeGen/Main.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Core/CodeGen/Main.php b/CRM/Core/CodeGen/Main.php index 1b754b959f..d108102259 100644 --- a/CRM/Core/CodeGen/Main.php +++ b/CRM/Core/CodeGen/Main.php @@ -5,6 +5,10 @@ */ class CRM_Core_CodeGen_Main { public $buildVersion; + + /** + * @var string + */ public $db_version; /** * drupal, joomla, wordpress @@ -76,11 +80,11 @@ class CRM_Core_CodeGen_Main { $versionFile = $this->phpCodePath . "/xml/version.xml"; $versionXML = CRM_Core_CodeGen_Util_Xml::parse($versionFile); - $this->db_version = $versionXML->version_no; + $this->db_version = (string) $versionXML->version_no; $this->buildVersion = preg_replace('/^(\d{1,2}\.\d{1,2})\.(\d{1,2}|\w{4,7})$/i', '$1', $this->db_version); if (isset($argVersion)) { // change the version to that explicitly passed, if any - $this->db_version = $argVersion; + $this->db_version = (string) $argVersion; } $this->schemaPath = $schemaPath; -- 2.25.1