Switches order of URL to put title first, and encodes ':' and '/' consistently with MediaWiki general URI encoding.
The current implementation escapes ':' and '/', producing URLs like this:
/trunk/index.php?action=raw&ctype=text/javascript&title=MediaWiki%3ASysop.js
If we're recommending consistent use of importScript() it probably doesn't really matter, but it wouldn't hurt to be self-consistent with how we generate other URLs... of course even with the change to the encoding, the order of the pieces is different.
MediaWiki usually generates URLs with the title component first; also caching options will differ depending on who's generating the URL and when.
pages if the repo wiki had a different canonical name for the File: namespace.
Added 'fileNamespace' configuration item to $wgForeignFileRepos to override
the local canonical name 'File' with another string.
+* (bug 13342) importScript() generates more consistent URI encoding
=== API changes in 1.14 ===
}
function importScript(page) {
- return importScriptURI(wgScript + '?action=raw&ctype=text/javascript&title=' + encodeURIComponent(page.replace(/ /g,'_')));
+ var uri = wgScript + '?title=' +
+ encodeURIComponent(page.replace(/ /g,'_')).replace('%2F','/').replace('%3A',':') +
+ '&action=raw&ctype=text/javascript';
+ return importScriptURI(uri);
}
var loadedScripts = {}; // included-scripts tracker