From c92ad40a10616109efdd9ddccb3358c1aefcefac Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 4 Jan 2023 13:51:07 -0500 Subject: [PATCH] encodeURIComponent is how we spell escape in this century from thinegen --- views/honkpage.js | 2 +- views/wonk.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/views/honkpage.js b/views/honkpage.js index 9d2bc66..fcd88a4 100644 --- a/views/honkpage.js +++ b/views/honkpage.js @@ -2,7 +2,7 @@ function encode(hash) { var s = [] for (var key in hash) { var val = hash[key] - s.push(escape(key) + "=" + escape(val)) + s.push(encodeURIComponent(key) + "=" + encodeURIComponent(val)) } return s.join("&") } diff --git a/views/wonk.js b/views/wonk.js index 2a242b2..135dd3b 100644 --- a/views/wonk.js +++ b/views/wonk.js @@ -6,7 +6,7 @@ export function addguesscontrols(elem, word, wordlist, xid) { host.guesses = [] host.xid = xid var xhr = new XMLHttpRequest() - xhr.open("GET", "/bloat/wonkles?w=" + escape(wordlist)) + xhr.open("GET", "/bloat/wonkles?w=" + encodeURIComponent(wordlist)) xhr.responseType = "json" xhr.onload = function() { var wordlist = xhr.response.wordlist