diff --git a/administrator/components/com_joomlaupdate/models/default.php b/administrator/components/com_joomlaupdate/models/default.php index ef862d4a4c949..960e5a46e1a7b 100644 --- a/administrator/components/com_joomlaupdate/models/default.php +++ b/administrator/components/com_joomlaupdate/models/default.php @@ -1032,7 +1032,7 @@ public function getPhpOptions() */ $option = new stdClass; $option->label = JText::sprintf('INSTL_PHP_VERSION_NEWER', $this->getTargetMinimumPHPVersion()); - $option->state = version_compare(PHP_VERSION, $this->getTargetMinimumPHPVersion(), '>='); + $option->state = $this->isPhpVersionSupported(); $option->notice = null; $options[] = $option; @@ -1221,6 +1221,19 @@ public function isDatabaseTypeSupported() return true; } + + /** + * Returns true, if current installed php version is compatible with the update. + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + public function isPhpVersionSupported() + { + return version_compare(PHP_VERSION, $this->getTargetMinimumPHPVersion(), '>='); + } + /** * Returns the PHP minimum version for the update. * Returns JOOMLA_MINIMUM_PHP, if there is no information given. diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default.php b/administrator/components/com_joomlaupdate/views/default/tmpl/default.php index bcede16e10277..733fe3e867ea5 100644 --- a/administrator/components/com_joomlaupdate/views/default/tmpl/default.php +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default.php @@ -64,8 +64,9 @@ updateInfo['object']->downloadurl->_data) && $this->updateInfo['installed'] < $this->updateInfo['latest']) - || !$this->getModel()->isDatabaseTypeSupported()) : ?> - + || !$this->getModel()->isDatabaseTypeSupported() + || !$this->getModel()->isPhpVersionSupported()) : ?> + loadTemplate('nodownload'); ?> updateInfo['hasUpdate']) : ?> diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default_nodownload.php b/administrator/components/com_joomlaupdate/views/default/tmpl/default_nodownload.php index 0e2153d2dba76..f369dfd1f8839 100644 --- a/administrator/components/com_joomlaupdate/views/default/tmpl/default_nodownload.php +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default_nodownload.php @@ -12,10 +12,30 @@ ?>
diff --git a/administrator/components/com_joomlaupdate/views/default/view.html.php b/administrator/components/com_joomlaupdate/views/default/view.html.php index 00d4e4ea3ba76..99dff659851e9 100644 --- a/administrator/components/com_joomlaupdate/views/default/view.html.php +++ b/administrator/components/com_joomlaupdate/views/default/view.html.php @@ -262,6 +262,7 @@ private function checkForSelfUpdate() public function shouldDisplayPreUpdateCheck() { return isset($this->updateInfo['object']->downloadurl->_data) - && $this->getModel()->isDatabaseTypeSupported(); + && $this->getModel()->isDatabaseTypeSupported() + && $this->getModel()->isPhpVersionSupported(); } } diff --git a/administrator/language/en-GB/en-GB.com_joomlaupdate.ini b/administrator/language/en-GB/en-GB.com_joomlaupdate.ini index 19bedd8cb5fcd..4ed6a49ebe09a 100644 --- a/administrator/language/en-GB/en-GB.com_joomlaupdate.ini +++ b/administrator/language/en-GB/en-GB.com_joomlaupdate.ini @@ -34,7 +34,11 @@ COM_JOOMLAUPDATE_VIEW_COMPLETE_HEADING="Joomla Version Update Status" COM_JOOMLAUPDATE_VIEW_COMPLETE_MESSAGE="Your site has been updated. Your Joomla version is now %s." COM_JOOMLAUPDATE_VIEW_DEFAULT_DOWNLOAD_IN_PROGRESS="Downloading update file. Please wait ..." COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL="We can't find a download URL" -COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL_DESC="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. There are two possibilities why this happens: