From: eileenmcnaugton Date: Mon, 7 Mar 2016 00:43:51 +0000 (+1300) Subject: CRM-18156 don't false positive on security update available X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=23a8613b3591fec18435427e9e06d00984c0556b;p=civicrm-core.git CRM-18156 don't false positive on security update available --- diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index a7bc93aed8..e7ecab9246 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -179,12 +179,17 @@ class CRM_Utils_VersionCheck { public function isSecurityUpdateAvailable() { $thisVersion = $this->getReleaseInfo($this->localVersion); $localVersionDate = CRM_Utils_Array::value('date', $thisVersion, 0); - foreach ($this->versionInfo as $majorVersion) { + // If not defined we will get an e-notice. That seems OK.... + $isLTS = $this->versionInfo[$this->localMajorVersion]['status'] === 'lts' ? TRUE : FALSE; + + foreach ($this->versionInfo as $majorVersionNumber => $majorVersion) { foreach ($majorVersion['releases'] as $release) { if (!empty($release['security']) && $release['date'] > $localVersionDate && version_compare($this->localVersion, $release['version']) < 0 ) { - if (!$this->ignoreDate || $this->ignoreDate < $release['date']) { + if ((!$this->ignoreDate || $this->ignoreDate < $release['date']) + && (!$isLTS || $majorVersionNumber === $this->localMajorVersion) + ) { return TRUE; } }