From cb1d48e098a4d8a8e059b4142995d9b9a64e63a8 Mon Sep 17 00:00:00 2001 From: Florian DAL FITTO Date: Sat, 9 Jul 2022 19:38:23 +0200 Subject: [PATCH] [K6.0] Kunena version displayed as GIT in cpanel on stable release (#9154) --- .../kunena/src/Forum/KunenaForum.php | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/src/libraries/kunena/src/Forum/KunenaForum.php b/src/libraries/kunena/src/Forum/KunenaForum.php index 7aa335e5776..608ad42009b 100644 --- a/src/libraries/kunena/src/Forum/KunenaForum.php +++ b/src/libraries/kunena/src/Forum/KunenaForum.php @@ -346,32 +346,24 @@ public static function version() */ protected static function buildVersion(): void { - if ('@kunenaversion@' == '@' . 'kunenaversion' . '@') + $file = JPATH_MANIFESTS . '/packages/pkg_kunena.xml'; + + if (file_exists($file)) { - $file = JPATH_MANIFESTS . '/packages/pkg_kunena.xml'; - - if (file_exists($file)) - { - $manifest = simplexml_load_file($file); - self::$version = (string) $manifest->version . '-GIT'; - self::$version_date = (string) $manifest->creationDate; - } - else - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $query = $db->getQuery(true); - $query->select('version')->from('#__kunena_version')->order('id'); - $query->setLimit(1); - $db->setQuery($query); - - self::$version = $db->loadResult(); - self::$version_date = Factory::getDate()->format('Y-m-d'); - } + $manifest = simplexml_load_file($file); + self::$version = (string) $manifest->version; + self::$version_date = (string) $manifest->creationDate; } else { - self::$version = strtoupper('@kunenaversion@'); - self::$version_date = strtoupper('@kunenaversiondate@'); + $db = Factory::getContainer()->get('DatabaseDriver'); + $query = $db->getQuery(true); + $query->select('version')->from('#__kunena_version')->order('id'); + $query->setLimit(1); + $db->setQuery($query); + + self::$version = $db->loadResult(); + self::$version_date = Factory::getDate()->format('Y-m-d'); } self::$version_major = substr(self::$version, 0, 3);