fix: use window.URL to avoid document.URL shadowing in inline handler

This commit is contained in:
NetworkCats
2026-03-08 04:16:32 +08:00
parent bc282c4279
commit 21249e1717
+1 -1
View File
@@ -1,6 +1,6 @@
<div class="footer-lang">
<label for="lang-select" class="sr-only">{{ t_language }}</label>
<select id="lang-select" class="lang-select" autocomplete="off" onchange="if(this.value){var u=new URL(this.value,window.location.origin);u.search=window.location.search;window.location.href=u.href}">
<select id="lang-select" class="lang-select" autocomplete="off" onchange="if(this.value){var u=new(window.URL)(this.value,window.location.origin);u.search=window.location.search;window.location.href=u.href}">
{% for l in all_locales %}
<option value="/{{ l.tag() }}"{% if *l == locale %} selected{% endif %}>{{ l.name() }}</option>
{% endfor %}