From 1e40c13c34f10eb8bf4cb0395f6a58dabe51456d Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Mon, 19 Feb 2018 09:10:17 +0100 Subject: [PATCH] Correcting github references --- component/admin/helpers/localise.php | 46 +++++++++++++++++----- component/admin/models/fields/releases.php | 6 ++- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/component/admin/helpers/localise.php b/component/admin/helpers/localise.php index 319c8b2e..d10fb8d2 100644 --- a/component/admin/helpers/localise.php +++ b/component/admin/helpers/localise.php @@ -1110,23 +1110,49 @@ public static function getReleases() $undoted = str_replace('.', '', $tag_name); $excluded = 0; - if ($tag_part[0] == '2' && $allow_25x == '0') + if (version_compare(JVERSION, '2', 'eq')) { $excluded = 1; } - elseif ($tag_part[0] != '3' && $tag_part[0] != '2') + elseif (version_compare(JVERSION, '3', 'eq')) { - // Exclude platforms or similar stuff. - $excluded = 1; + if ($tag_part[0] != '3') + { + $excluded = 1; + } + } + elseif (version_compare(JVERSION, '4', 'ge')) + { + if ($tag_part[0] == '4' || $tag_part[0] == '3') + { + $excluded = 0; + } + else + { + $excluded = 1; + } } - // Filtering also by "is_numeric" disable betas or similar releases. - if (!in_array($tag_name, $versions) && is_numeric($undoted) && $excluded == 0) + // Filtering by "is_numeric" disable betas or similar releases. + if ($params->get('pre_stable', '0') == '0') { - $versions[] = $tag_name; - JFactory::getApplication()->enqueueMessage( - JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), - 'notice'); + if (!in_array($tag_name, $versions) && is_numeric($undoted) && $excluded == 0) + { + $versions[] = $tag_name; + JFactory::getApplication()->enqueueMessage( + JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), + 'notice'); + } + } + else + { + if (!in_array($tag_name, $versions) && $excluded == 0) + { + $versions[] = $tag_name; + JFactory::getApplication()->enqueueMessage( + JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), + 'notice'); + } } } } diff --git a/component/admin/models/fields/releases.php b/component/admin/models/fields/releases.php index 5885f036..518526de 100644 --- a/component/admin/models/fields/releases.php +++ b/component/admin/models/fields/releases.php @@ -90,7 +90,11 @@ protected function getOptions() $undoted = str_replace('.', '', $tag_name); $excluded = 0; - if (version_compare(JVERSION, '3', 'ge')) + if (version_compare(JVERSION, '2', 'eq')) + { + $excluded = 1; + } + elseif (version_compare(JVERSION, '3', 'eq')) { if ($tag_part[0] != '3') {