mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Fix version comparison (#376)
This commit is contained in:
parent
bb3ca31fd2
commit
0070bebf3d
1 changed files with 3 additions and 3 deletions
|
|
@ -795,7 +795,7 @@ keepass.keePassXCUpdateAvailable = function() {
|
|||
}
|
||||
}
|
||||
|
||||
return keepass.compareVersion(keepass.currentKeePassXC, keepass.latestKeePassXC.version);
|
||||
return keepass.compareVersion(keepass.currentKeePassXC, keepass.latestKeePassXC.version, false);
|
||||
};
|
||||
|
||||
keepass.checkForNewKeePassXCVersion = function() {
|
||||
|
|
@ -1070,12 +1070,12 @@ keepass.updateDatabase = function() {
|
|||
}, null);
|
||||
};
|
||||
|
||||
keepass.compareVersion = function(minimum, current) {
|
||||
keepass.compareVersion = function(minimum, current, canBeEqual = true) {
|
||||
if (!minimum || !current) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const min = minimum.split('.', 3).map(s => s.padStart(4, '0')).join('.');
|
||||
const cur = current.split('.', 3).map(s => s.padStart(4, '0')).join('.');
|
||||
return min <= cur;
|
||||
return (canBeEqual ? (min <= cur) : (min < cur));
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue