Electron: Sanitize application version during update check (#3933)

This commit is contained in:
Alexander Zinchuk 2023-11-06 01:43:00 +04:00
parent 9b37c1a77a
commit 94b5c31103

View File

@ -1,5 +1,7 @@
const APP_VERSION_REGEX = /^\d+\.\d+(\.\d+)?$/;
export default function getIsAppUpdateNeeded(remoteVersion: string, appVersion: string) {
return APP_VERSION_REGEX.test(remoteVersion) && remoteVersion !== appVersion;
const sanitizedRemoteVersion = remoteVersion.trim();
return APP_VERSION_REGEX.test(sanitizedRemoteVersion) && sanitizedRemoteVersion !== appVersion;
}