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';