From: Ilmari Karonen Date: Tue, 12 May 2009 23:56:28 +0000 (+0000) Subject: unencode all slashes and colons in importScript(), not just the first one of each X-Git-Tag: 1.31.0-rc.0~41813 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=17787467a63b4559258b2a7a682f719249ce21c0;p=lhc%2Fweb%2Fwiklou.git unencode all slashes and colons in importScript(), not just the first one of each --- 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); }