diff --git a/libraries/joomla/updater/adapters/collection.php b/libraries/joomla/updater/adapters/collection.php index c52ac60a1a643..b6ef312a977f0 100644 --- a/libraries/joomla/updater/adapters/collection.php +++ b/libraries/joomla/updater/adapters/collection.php @@ -162,14 +162,16 @@ public function _startElement($parser, $name, $attrs = array()) { $values['targetplatform'] = $product; } + // Set this to ourself as a default if (!isset($values['targetplatformversion'])) { $values['targetplatformversion'] = $ver->RELEASE; } + // Set this to ourselves as a default // validate that we can install the extension - if ($product == $values['targetplatform'] && preg_match('/' . $values['targetplatformversion'] . '/', $ver->RELEASE)) + if ($product == $values['targetplatform'] && preg_match('/^' . $values['targetplatformversion'] . '/', JVERSION)) { $update->bind($values); $this->updates[] = $update; diff --git a/libraries/joomla/updater/adapters/extension.php b/libraries/joomla/updater/adapters/extension.php index b4787ec628f98..6c333ba923bf3 100644 --- a/libraries/joomla/updater/adapters/extension.php +++ b/libraries/joomla/updater/adapters/extension.php @@ -97,10 +97,16 @@ protected function _endElement($parser, $name) // Lower case and remove the exclamation mark $product = strtolower(JFilterInput::getInstance()->clean($ver->PRODUCT, 'cmd')); - // Check that the product matches and that the version matches (optionally a regexp) - // Check for optional min_dev_level and max_dev_level attributes to further specify targetplatform (e.g., 3.0.1) + /* + * Check that the product matches and that the version matches (optionally a regexp) + * + * NOTE: Support for the min_dev_level and max_dev_level attributes is deprecated, a regexp should be + * used instead + * + * Check for optional min_dev_level and max_dev_level attributes to further specify targetplatform (e.g., 3.0.1) + */ if ($product == $this->currentUpdate->targetplatform['NAME'] - && preg_match('/' . $this->currentUpdate->targetplatform['VERSION'] . '/', $ver->RELEASE) + && preg_match('/^' . $this->currentUpdate->targetplatform['VERSION'] . '/', JVERSION) && ((!isset($this->currentUpdate->targetplatform->min_dev_level)) || $ver->DEV_LEVEL >= $this->currentUpdate->targetplatform->min_dev_level) && ((!isset($this->currentUpdate->targetplatform->max_dev_level)) || $ver->DEV_LEVEL <= $this->currentUpdate->targetplatform->max_dev_level)) {