Electron: Sanitize application version during update check (#3933)
This commit is contained in:
parent
9b37c1a77a
commit
94b5c31103
@ -1,5 +1,7 @@
|
|||||||
const APP_VERSION_REGEX = /^\d+\.\d+(\.\d+)?$/;
|
const APP_VERSION_REGEX = /^\d+\.\d+(\.\d+)?$/;
|
||||||
|
|
||||||
export default function getIsAppUpdateNeeded(remoteVersion: string, appVersion: string) {
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user