1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-07 14:23:53 +00:00

Fix problem with version checking logic

Previously, importing a plugin with a semantically identical version
number was not rejected. This meant that attempts to import
5.0.9-prerelease wikis into 5.0.9-beta led to a corrupted wiki, with a
beta core and prerelease plugins.
This commit is contained in:
Jermolene 2014-04-17 11:59:42 +01:00
parent 6db94052c7
commit bd4a031df8

View File

@ -352,7 +352,7 @@ $tw.utils.parseVersion = function(version) {
}; };
/* /*
Returns true if the version string A is greater than the version string B Returns true if the version string A is greater than the version string B. Returns true if the versions are the same
*/ */
$tw.utils.checkVersions = function(versionStringA,versionStringB) { $tw.utils.checkVersions = function(versionStringA,versionStringB) {
var defaultVersion = { var defaultVersion = {
@ -369,7 +369,8 @@ $tw.utils.checkVersions = function(versionStringA,versionStringB) {
]; ];
return (diff[0] > 0) || return (diff[0] > 0) ||
(diff[0] === 0 && diff[1] > 0) || (diff[0] === 0 && diff[1] > 0) ||
(diff[0] === 0 && diff[1] === 0 && diff[2] > 0); (diff[0] === 0 && diff[1] === 0 && diff[2] > 0) ||
(diff[0] === 0 && diff[1] === 0 && diff[2] === 0);
}; };
/* /*