From b5b5e80c103aeee3c8d5b48218af445df2116d12 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Wed, 26 Oct 2022 04:34:01 +0200 Subject: [PATCH] Validate version number better --- packages/client/src/pages/admin/index.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/client/src/pages/admin/index.vue b/packages/client/src/pages/admin/index.vue index 4fcfd8585e..507660d58c 100644 --- a/packages/client/src/pages/admin/index.vue +++ b/packages/client/src/pages/admin/index.vue @@ -69,7 +69,9 @@ os.api('admin/abuse-user-reports', { }); os.api('latest-version').then(res => { - if (res?.tag_name !== version) { + const cleanRes = parseInt(res?.tag_name.replace(/[^0-9]/g, ''), 10); + const cleanVersion = parseInt(version.replace(/[^0-9]/g, ''), 10); + if (cleanRes > cleanVersion) { updateAvailable = true; } });