Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Dec 26, 2024
1 parent cd101e4 commit 8791588
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions - gadgets/Gadget-popups.js
Original file line number Diff line number Diff line change
Expand Up @@ -6898,9 +6898,11 @@ $(function () {
function setMainRegex() {
var reStart = '[^:]*://';
var preTitles =
literalizeRegex(mw.config.get('wgScriptPath')) + '/(?:index[.]php|wiki[.]phtml)[?]title=';
preTitles += '|' + literalizeRegex(pg.wiki.articlePath + '/');

// Take customizable wgScript into account (it isn't guaranteed to be index.php)
'(?:' + literalizeRegex(mw.config.get('wgScript')) + '|' +
// handle index.php (likely to work even if different from wgScript) and legacy wiki.phtml
literalizeRegex(mw.config.get('wgScriptPath')) + '/(?:index[.]php|wiki[.]phtml))';
preTitles += '[?]title=|' + literalizeRegex(pg.wiki.articlePath + '/');
var reEnd = '(' + preTitles + ')([^&?#]*)[^#]*(?:#(.+))?';
pg.re.main = RegExp(reStart + literalizeRegex(pg.wiki.sitebase) + reEnd);
}
Expand Down

0 comments on commit 8791588

Please sign in to comment.