Skip to content

Commit

Permalink
[#29445] Allow different update packages for different version dev
Browse files Browse the repository at this point in the history
levels
  • Loading branch information
dextercowley committed Oct 6, 2012
1 parent 47dc71a commit 7b36818
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions installation/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ $ -> Language fix or change
- -> Removed
! -> Note

06-Oct-2012 Mark Dexter
+ [#29445] Allow different update packages for different version dev levels.

06-Oct-2012 Jean-Marie Simonet
# [#29262] Wrong file name in garbagecoro cli app

Expand Down
5 changes: 4 additions & 1 deletion libraries/joomla/updater/adapters/extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ protected function _endElement($parser, $name)
$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)
if ($product == $this->current_update->targetplatform['NAME']
&& preg_match('/' . $this->current_update->targetplatform['VERSION'] . '/', $ver->RELEASE))
&& preg_match('/' . $this->currentUpdate->targetplatform->version . '/', $ver->RELEASE)
&& ((!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))
{
// Target platform isn't a valid field in the update table so unset it to prevent J! from trying to store it
unset($this->current_update->targetplatform);
Expand Down
5 changes: 4 additions & 1 deletion libraries/joomla/updater/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,11 @@ public function _endElement($parser, $name)
case 'UPDATE':
$ver = new JVersion;
$product = strtolower(JFilterInput::getInstance()->clean($ver->PRODUCT, 'cmd'));
// 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 . '/', $ver->RELEASE)
&& ((!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))
{
if (isset($this->latest))
{
Expand Down

0 comments on commit 7b36818

Please sign in to comment.