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 @@ ?>
- - - -

- updateInfo['latest']); ?> -

+ getModel()->isDatabaseTypeSupported()) : ?> + + + +

+ updateInfo['latest']); ?> +

+ + getModel()->isPhpVersionSupported()) : ?> + + + +

+ updateInfo['latest']); ?> +

+ + updateInfo['object']->downloadurl->_data) && $this->updateInfo['installed'] < $this->updateInfo['latest'] && $this->getModel()->isPhpVersionSupported() && $this->getModel()->isDatabaseTypeSupported()) : ?> + + + +

+ updateInfo['latest']); ?> +

+ + +
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:
- Your host doesn't support the minimum requirements for Joomla %1$s and there is no alternative download for your configuration available.
- There is a problem with the Joomla Update Server.

Please try to download the update package from the official Joomla download page and use the Upload and Update tab." +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 is a problem with the Joomla Update Server.
Please try to download the update package from the official Joomla download page and use the Upload and Update tab." +COM_JOOMLAUPDATE_VIEW_DEFAULT_DB_NOT_SUPPORTED="Your database type is not supported" +COM_JOOMLAUPDATE_VIEW_DEFAULT_DB_NOT_SUPPORTED_DESC="An update to Joomla %1$s was found, but your current database type is not supported by the new version.
For further details take a look at the minimum requirements for Joomla %1$s." +COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NOT_SUPPORTED="Your PHP version is not supported" +COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NOT_SUPPORTED_DESC="An update to Joomla %1$s was found, but your currently installed PHP version does not match the minimum requirements for Joomla %1$s." COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE="Live Update is not available" COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE_DESC="There is a new version of the Joomla Update Component that needs to be installed first. Click here to update the component." COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_DIRECTORY="FTP Root" diff --git a/libraries/src/Updater/Update.php b/libraries/src/Updater/Update.php index dced0de77cf75..058075c1b7a9b 100644 --- a/libraries/src/Updater/Update.php +++ b/libraries/src/Updater/Update.php @@ -389,6 +389,11 @@ public function _endElement($parser, $name) $this->latest = $this->currentUpdate; } } + else + { + $this->latest = new \stdClass; + $this->latest->php_minimum = $this->currentUpdate->php_minimum; + } } break; case 'UPDATES':