russblau created this task.
russblau added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Liuxinyu970226,
Aklapper.
TASK DESCRIPTION
Page.botMayEdit() should return False if the page contains
{{nobots|allow=Foo}} unless "Foo" matches the bot's username. But it will
always return True in this situation.
The bug is in the following code snippet in page/__init__.py:
for template, params in templates:
title = template.title(with_ns=False)
if restrictions:
if title in restrictions:
return False
if title == 'Nobots':
if not params:
return False
else:
bots = [bot.strip() for bot in params[0].split(',')]
### BUG
if 'all' in bots or pywikibot.calledModuleName() in bots
\
or username in bots:
return False
On the line tagged with ### BUG, the value of bots in the example given will
be the string "allow=Foo"; this should then be split on the '=' to get the
actual list of allowed bots. Because it is not split, the if statement on the
next line always matches when the "allow" parameter is present. After splitting
the arguments, the method should use logic similar to that in the next section
(under elif title == 'Bots':) to parse the parameters and return the
appropriate value.
TASK DETAIL
https://phabricator.wikimedia.org/T253709
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: russblau
Cc: Aklapper, Liuxinyu970226, russblau, pywikibot-bugs-list, JohnsonLee01,
Dijkstra, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Dvorapa,
Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs