Skip to content

Commit

Permalink
batchprotect/batchdelete: fix bug in batchprotect
Browse files Browse the repository at this point in the history
PrefixIndex URLs use `prefix` parameter, not a `from` parameter.
Also, mw.util.getParamValue takes care of converting `+` to space, (though queryString also does that since f0866be; before that commit this was a bug)
Also, use of Morebits.toUpperCaseFirstChar is unnecessary, that is taken care of by the API.
  • Loading branch information
siddharthvp committed Jan 10, 2020
1 parent 0089abb commit 5bd6047
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/twinklebatchdelete.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Twinkle.batchdelete.callback = function twinklebatchdeleteCallback() {
query.gaplimit = Twinkle.getPref('batchMax'); // the max for sysops
if (mw.util.getParamValue('prefix')) {
query.gapnamespace = mw.util.getParamValue('namespace');
query.gapprefix = Morebits.string.toUpperCaseFirstChar(mw.util.getParamValue('prefix'));
query.gapprefix = mw.util.getParamValue('prefix');
} else {
var pathSplit = decodeURIComponent(location.pathname).split('/');
if (pathSplit.length < 3 || pathSplit[2] !== 'Special:PrefixIndex') {
Expand Down
2 changes: 1 addition & 1 deletion modules/twinklebatchprotect.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ Twinkle.batchprotect.callback = function twinklebatchprotectCallback() {
} else if (mw.config.get('wgCanonicalSpecialPageName') === 'Prefixindex') {
query.generator = 'allpages';
query.gapnamespace = mw.util.getParamValue('namespace') || $('select[name=namespace]').val();
query.gapprefix = Morebits.string.toUpperCaseFirstChar(mw.util.getParamValue('from') ? mw.util.getParamValue('from').replace('+', ' ') : $('input[name=prefix]').val());
query.gapprefix = mw.util.getParamValue('prefix') || $('input[name=prefix]').val();
query.gaplimit = Twinkle.getPref('batchMax'); // the max for sysops
} else {
query.generator = 'links';
Expand Down

0 comments on commit 5bd6047

Please sign in to comment.