diff --git a/src/EGO MAUL Enhancement.ts b/src/EGO MAUL Enhancement.ts index 362a409..9652386 100644 --- a/src/EGO MAUL Enhancement.ts +++ b/src/EGO MAUL Enhancement.ts @@ -3,7 +3,7 @@ // @namespace https://github.com/blankdvth/eGOScripts/blob/master/src/EGO%20MAUL%20Enhancement.ts // @downloadURL %DOWNLOAD_URL% // @updateURL %DOWNLOAD_URL% -// @version 4.1.1 +// @version 4.2.1 // @description Add various enhancements & QOL additions to the EdgeGamers MAUL page that are beneficial for CS Leadership members. // @author blank_dvth, Left, Skle, MSWS // @match https://maul.edgegamers.com/* @@ -507,19 +507,34 @@ function handleProfile() { ...document.querySelectorAll("div.col-xs-6 > div > div:nth-child(3)"), ]; userNotes.forEach((userNote) => { - if (!userNote.textContent) return; - userNote.textContent = userNote.textContent.replaceAll( - /(?:https?:\/\/)?(?:www\.)?edge-gamers\.com\/forums\/showthread\.php\?p=(\d+)(?:#?post(\d+))?/g, - function (match, threadId, postId) { - return generateForumsURL(threadId, postId); - } - ); - userNote.textContent = userNote.textContent.replaceAll( - /(?:https?:\/\/)?(?:www\.)?edge-gamers\.com\/forums\/showthread\.php\?(\d+)[\-a-zA-Z]*/g, - function (match, threadId) { - return generateForumsURL(threadId, null); - } - ); + if ( + !userNote.textContent || + userNote.innerHTML.includes("<") || + userNote.innerHTML.includes(">") + ) + // Empty or possible HTML injection + return; + userNote.innerHTML = userNote.textContent + .replaceAll( + /(?:https?:\/\/)?(?:www\.)?edge-gamers\.com\/forums\/showthread\.php\?p=(\d+)(?:#?post(\d+))?/g, + function (match, threadId, postId) { + return generateForumsURL(threadId, postId); + } + ) + .replaceAll( + /(?:https?:\/\/)?(?:www\.)?edge-gamers\.com\/forums\/showthread\.php\?(\d+)[\-a-zA-Z]*/g, + function (match, threadId) { + return generateForumsURL(threadId, null); + } + ) + .replaceAll( + /https?:\/\/(www\.)?[-a-zA-Z0-9.]{1,256}\.[a-zA-Z0-9]{2,6}\b(\/[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/g, + '$&' + ) + .replaceAll( + /([^\/\d]|^)(\d{17})([^\/\d]|$)/g, + '$1$2$3' + ); }); // Attempt to get Source ID @@ -654,7 +669,7 @@ function updateBanNoteURLs() { handleProfile(); else if ( url.match( - /^https:\/\/maul\.edgegamers\.com\/index\.php\?[-=a-zA-Z0-9&]*page=bans.*$/ + /^https:\/\/maul\.edgegamers\.com\/index\.php\?.*page=bans.*$/ ) ) // List Ban Page