MediaWiki:Gadget-find-archived-section.js: Difference between revisions
Content deleted Content added
prevent search for section names beginning with interwiki prefix followed by colon (such as "RfC:") to lead outside the wiki; remove mw.util dependency |
fix colon problem |
||
Line 19:
prefix = encodeURIComponent(prefix);
var hashColonFixed = hash.replace(/^([A-Za-z]+):/, '$1'); // remove colon that may get interpreted as an interwiki links, otherwise the search link will go straight to the interwiki page.
var search = encodeURIComponent('"' +
▲ var search = encodeURIComponent('"' + hash.replace(/(\w+):/, '$1').replace(/_/g, ' ') + '"');
var searchLink = mw.config.get('wgScript')
|