diff --git a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php index 5b2bc74f08d0a..b28ed81f2c716 100644 --- a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php +++ b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php @@ -1632,7 +1632,7 @@ private function checkCompatibility($updateFileUrl, $joomlaTargetVersion) $minimumStability = ComponentHelper::getParams('com_installer')->get('minimum_stability', Updater::STABILITY_STABLE); $update = new Update(); - $update->set('jversion.full', $joomlaTargetVersion); + $update->setTargetVersion($joomlaTargetVersion); $update->loadFromXml($updateFileUrl, $minimumStability); $compatibleVersions = $update->get('compatibleVersions'); diff --git a/libraries/src/Updater/Update.php b/libraries/src/Updater/Update.php index ed4e42bddbeff..2efd6a0662e7e 100644 --- a/libraries/src/Updater/Update.php +++ b/libraries/src/Updater/Update.php @@ -256,11 +256,21 @@ class Update protected $stability; protected $supported_databases; protected $php_minimum; + protected $folder; + protected $changelogurl; public $sha256; public $sha384; public $sha512; protected $section; + /** + * Joomla! target version used by the pre-update check + * + * @var string + * @since __DEPLOY_VERSION__ + */ + private $targetVersion; + /** * Gets the reference to the current direct parent * @@ -372,7 +382,7 @@ public function _endElement($parser, $name) if ( isset($this->currentUpdate->targetplatform->name) && $product == $this->currentUpdate->targetplatform->name - && preg_match('/^' . $this->currentUpdate->targetplatform->version . '/', $this->get('jversion.full', JVERSION)) + && preg_match('/^' . $this->currentUpdate->targetplatform->version . '/', $this->getTargetVersion()) ) { // Collect information on updates which do not meet PHP and DB version requirements $otherUpdateInfo = new \stdClass(); @@ -690,4 +700,34 @@ protected function stabilityTagToInteger($tag) return Updater::STABILITY_STABLE; } + + /** + * Set extension's Joomla! target version + * + * @param string $version The target version + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function setTargetVersion($version) + { + $this->targetVersion = $version; + } + + /** + * Get extension's Joomla! target version + * + * @return string + * + * @since __DEPLOY_VERSION__ + */ + public function getTargetVersion() + { + if (!$this->targetVersion) { + return JVERSION; + } + + return $this->targetVersion; + } }