Skip to content

Accurate compare#6

Merged
kenlog merged 7 commits intomasterfrom
app-version-master
Dec 15, 2018
Merged

Accurate compare#6
kenlog merged 7 commits intomasterfrom
app-version-master

Conversation

@creecros
Copy link
Collaborator

  • Version Compare was incorrect
  • Uses ChangeLog when APP_VERSION is master

@creecros
Copy link
Collaborator Author

if (filter_var(APP_VERSION, FILTER_SANITIZE_NUMBER_INT) < filter_var($value->title, FILTER_SANITIZE_NUMBER_INT))

This was a flawed condition, for example, this statement was changing Version 1.0.46 to 1046 and comparing to Version 1.2.6, as 126. i.e. if (1046 < 126) which is incorrect.

Switched to version_compare(), so that now it is comparing 1.0.46 & 1.2.6

if (version_compare($applications_version, trim($value->title, 'Kanboard ')) < 0)

@creecros
Copy link
Collaborator Author

Actually that is flawed too, I noticed Fred Guillot doesn't always Title with Kanboard , sometimes he uses Kanboard Version.

This one works always:

if (version_compare($applications_version, trim(preg_replace('/[A-Za-z]/', '', $value->title), ' ')) < 0) 

@creecros creecros requested a review from kenlog December 14, 2018 21:44
@kenlog kenlog merged commit 70a2b95 into master Dec 15, 2018
@kenlog kenlog deleted the app-version-master branch December 17, 2018 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants