From 17787467a63b4559258b2a7a682f719249ce21c0 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Tue, 12 May 2009 23:56:28 +0000 Subject: [PATCH] unencode all slashes and colons in importScript(), not just the first one of each --- skins/common/wikibits.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index 30686fb48e..5e8e6adafd 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -49,8 +49,9 @@ function hookEvent(hookName, hookFunct) { } function importScript(page) { + // TODO: might want to introduce a utility function to match wfUrlencode() in PHP var uri = wgScript + '?title=' + - encodeURIComponent(page.replace(/ /g,'_')).replace('%2F','/').replace('%3A',':') + + encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') + '&action=raw&ctype=text/javascript'; return importScriptURI(uri); } -- 2.20.1