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.
print-window-tiddler
Jermolene 2014-04-17 11:59:42 +01:00
rodzic 6db94052c7
commit bd4a031df8
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -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);
}; };
/* /*