From d83c522f31569bed9d81388b9d1dafec7fe2ffa9 Mon Sep 17 00:00:00 2001 From: boomzero Date: Sun, 22 Jun 2025 20:17:32 +0800 Subject: [PATCH 1/3] fix: Redirect to login page if profile element is missing Closes #286 --- XMOJ.user.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/XMOJ.user.js b/XMOJ.user.js index 6075d804..0961d23a 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -559,6 +559,9 @@ window.addEventListener('DOMContentLoaded', async () => { let SearchParams = new URLSearchParams(location.search); let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.me/" : "https://www.xmoj-bbs.me") + if (document.querySelector("#profile") === null) { + location.href = "https://www.xmoj.tech/loginpage.php"; + } let CurrentUsername = document.querySelector("#profile").innerText; CurrentUsername = CurrentUsername.replaceAll(/[^a-zA-Z0-9]/g, ""); let IsAdmin = AdminUserList.indexOf(CurrentUsername) !== -1; From f6742dc03bec4f7f6613e27bd0a4f65c215c8343 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 22 Jun 2025 12:19:28 +0000 Subject: [PATCH 2/3] 1.7.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 76b8b358..e034b7fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "1.7.2", + "version": "1.7.3", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From b28f440cc8db7b63b40047baa2f5e92ffec2bd46 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 22 Jun 2025 12:19:34 +0000 Subject: [PATCH 3/3] Update version info to 1.7.3 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index ce92ef55..ecb95bec 100644 --- a/Update.json +++ b/Update.json @@ -2873,6 +2873,17 @@ } ], "Notes": "No release notes were provided for this release." + }, + "1.7.3": { + "UpdateDate": 1750594769202, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 811, + "Description": "fix: Redirect to login page if profile element is missing" + } + ], + "Notes": "No release notes were provided for this release." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 0961d23a..ebaa803b 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.7.2 +// @version 1.7.3 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen