From e3a8d9dff84bb28eb5c25ae9c76f6a59227ba565 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Sun, 2 Aug 2026 20:34:23 +0530 Subject: [PATCH] fix: code quality and safety improvements --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index f04afa5..7f79710 100644 --- a/main.js +++ b/main.js @@ -919,7 +919,7 @@ const MAX_PROFILE_NAME_LENGTH = 64; const SAFE_PROFILE_NAME_RE = /^[A-Za-z0-9 _\-()À-ɏ]{1,64}$/; function isValidProfileName(name) { - if (typeof name !== "string" || name.trim() === "") return false; + if (typeof name !== "string" || name.trim().length === 0) return false; if (RESERVED_PROFILE_NAMES.has(name)) return false; return SAFE_PROFILE_NAME_RE.test(name); } @@ -1065,7 +1065,7 @@ function getThemeProfiles() { const ALLOWED_EXTERNAL_SCHEMES = new Set(["https:", "http:"]); function openExternalUrl(url) { - if (typeof url !== "string" || url.trim() === "") { + if (typeof url !== "string" || url.trim().length === 0) { console.warn("[Paraline] openExternalUrl(): invalid url payload:", url); return; }