From 3532678ae0e0ffe8b64a4881a3cd386a754efd8b Mon Sep 17 00:00:00 2001 From: Chlod Alejandro Date: Mon, 1 Apr 2024 22:42:32 +0800 Subject: [PATCH] Encode article title in WikiWho API access The article title is not URL encoded when the WikiWho API URL is being constructed (Api.js#getAjaxURL). This causes any article with a question mark to have a URL containing query parameters starting wherever the question mark is. --- src/Api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api.js b/src/Api.js index 3d3cc15..2b105b3 100644 --- a/src/Api.js +++ b/src/Api.js @@ -126,7 +126,7 @@ class Api { this.url, subdomain, 'whocolor/v1.0.0-beta', - this.mwConfig.get( 'wgPageName' ), + encodeURIComponent( this.mwConfig.get( 'wgPageName' ) ), // Always include the revision ID, to make sure we are always asking for // the correct revision, whether the page was just edited, or, whether the // page was edited by someone else while we were looking at the current page