User:Bosco/MediaWiki:Gadget-MarkRights.js: Difference between revisions
From Test Wiki
Content deleted Content added
TypeError: groups[group].list.includes is not a function, the `includes` function cannot be used safely unless feature detection is used first given we support older browsers that are running older versions of JavaScript. |
Fix Uncaught URIError: URI malformed |
||
| Line 64: | Line 64: | ||
var username = mw.util.getParamValue('title', url); |
var username = mw.util.getParamValue('title', url); |
||
if (username) { |
if (username) { |
||
return decodeURIComponent(username.replace('User:', '').replace(/_/g, ' ')); |
return decodeURIComponent(username.replace('User:', '').replace(/_/g, ' ').replace(/%/g, '%25')); |
||
} |
} |
||
username = url.match(/\/wiki\/User:(.+?)$/); |
username = url.match(/\/wiki\/User:(.+?)$/); |
||
if (username) { |
if (username) { |
||
return decodeURIComponent(username[1].replace(/_/g, ' ')); |
return decodeURIComponent(username[1].replace(/_/g, ' ').replace(/%/g, '%25')); |
||
} |
} |
||
return null; |
return null; |
||