Improve hasUpdate checks and make sure we don't offer updates to outdated versions#25810
Merged
HLeithner merged 7 commits intojoomla:stagingfrom Aug 23, 2019
Merged
Improve hasUpdate checks and make sure we don't offer updates to outdated versions#25810HLeithner merged 7 commits intojoomla:stagingfrom
HLeithner merged 7 commits intojoomla:stagingfrom
Conversation
mbabker
reviewed
Aug 11, 2019
| $ret['latest'] = $updateObject->version; | ||
| $ret['hasUpdate'] = $updateObject->version != JVERSION; | ||
| // Check whether this is an valid update or not | ||
| if (version_compare($updateObject->version, JVERSION) === -1) |
Contributor
There was a problem hiding this comment.
Use version_compare() with three arguments, i.e. version_compare($updateObject->version, JVERSION, '<='). I've been writing PHP for 10 years and I couldn't tell you a thing about any of the return values of version_compare(), whereas specifying the comparison as the third parameter makes it crystal clear what you're intending here.
Contributor
Author
There was a problem hiding this comment.
has been patched thanks 👍
wilsonge
approved these changes
Aug 11, 2019
richard67
reviewed
Aug 11, 2019
Member
|
I have tested this item ✅ successfully on a5f0ef2 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25810. |
1 similar comment
Contributor
|
I have tested this item ✅ successfully on a5f0ef2 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25810. |
Contributor
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25810. |
Co-Authored-By: Richard Fath <richard67@users.noreply.github.com>
Member
|
I have tested this item ✅ successfully on dcf8c97 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25810. |
Member
|
Last change was only a code comment correction so @alikon 's test result is still valid. |
Member
|
Thank you for stop downgrading offers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Improve hasUpdate checks and make sure we don't offer downgrades to outdated versions
Testing Instructions
Expected result
When we have an old version in the cache joomla says it runs the latest version
Actual result
When we have an older version in the cache Joomla wants to update to that version.
Documentation Changes Required
none
Additional info
The behavior we build by manually changing the database table can happen in case there is some caching of the old version of the update for some reason. one of many examples (german): https://forum.joomla.de/thread/8109-joomla-update-wird-nicht-angeboten-bzw-falsches-update-3-9-10/