r50537 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50536‎ | r50537 | r50538 >
Date:23:56, 12 May 2009
Author:vyznev
Status:ok
Tags:
Comment:
unencode all slashes and colons in importScript(), not just the first one of each
Modified paths:
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -49,8 +49,9 @@
5050 }
5151
5252 function importScript(page) {
 53+ // TODO: might want to introduce a utility function to match wfUrlencode() in PHP
5354 var uri = wgScript + '?title=' +
54 - encodeURIComponent(page.replace(/ /g,'_')).replace('%2F','/').replace('%3A',':') +
 55+ encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') +
5556 '&action=raw&ctype=text/javascript';
5657 return importScriptURI(uri);
5758 }

Status & tagging log