« get me outta code hell

validators: isURL: try decodeURIComponent on pathname - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-04-12 07:42:26 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-04-12 07:44:39 -0300
commit5fcd8ce38402c6623b57a5dc846c9786a24644f1 (patch)
tree558302026e5b08bf80b3c51e4c5008de4ba4a950 /src
parent5b03e4f671f45378de5ebb006f05cf288805aa66 (diff)
validators: isURL: try decodeURIComponent on pathname
Diffstat (limited to 'src')
-rw-r--r--src/validators.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/validators.js b/src/validators.js
index 1c9ce9e3..73fcf7bc 100644
--- a/src/validators.js
+++ b/src/validators.js
@@ -710,7 +710,11 @@ export function isName(name) {
 export function isURL(string) {
   isStringNonEmpty(string);
 
-  new URL(string);
+  // This might error.
+  const url = new URL(string);
+
+  // This might, too.
+  decodeURIComponent(url.pathname);
 
   return true;
 }