From e081f3da143d05069fc364e35a204892b740b4b2 Mon Sep 17 00:00:00 2001 From: Phileco <132178579+krishnprakash@users.noreply.github.com> Date: Thu, 19 Feb 2026 18:17:52 +0530 Subject: [PATCH] Potential fix for code scanning alert no. 1: DOM text reinterpreted as HTML Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Phileco <132178579+krishnprakash@users.noreply.github.com> --- js/page.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/page.js b/js/page.js index a8d52e72..9b3298bf 100644 --- a/js/page.js +++ b/js/page.js @@ -1,7 +1,12 @@ $('#small-nav-dropdown').change(function() { - window.location = $(this) + var selectedValue = $(this) .find('option:selected') - .val() + .val(); + if (/^https?:\/\/[^\s/$.?#].[^\s]*$/.test(selectedValue)) { + window.location = selectedValue; + } else { + console.error('Invalid URL:', selectedValue); + } }) const site_tag = 'UA-62780441-30';