diff --git a/airtime_mvc/application/views/helpers/VersionNotify.php b/airtime_mvc/application/views/helpers/VersionNotify.php index 7e6c873c2..ca9aaf419 100644 --- a/airtime_mvc/application/views/helpers/VersionNotify.php +++ b/airtime_mvc/application/views/helpers/VersionNotify.php @@ -23,11 +23,14 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract { $latest = Application_Model_Preference::GetLatestVersion(); $link = Application_Model_Preference::GetLatestLink(); - $isGitRelease = preg_match('/^[[:alnum:]]{7}$/i', $current) === 1; - $currentParts = array(0, 0, 0, 0); + $isGitRelease = preg_match('/^[[:alnum:]]{7,}$/i', $current) === 1; + $currentParts = array(); if (!$isGitRelease) { $currentParts = preg_split("/(\.|-)/", $current); } + if (count($currentParts) < 3) { + $currentParts = array(0, 0, 0, 0); + } $majorCandidates = SemVer::satisfiedBy($latest, sprintf('>=%1$s', $currentParts[0] + 1)); $minorCandidates = SemVer::satisfiedBy($latest, sprintf('~%1$s.%2$s', $currentParts[0], $currentParts[1] + 1));