jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405583 )
Change subject: [IMPR] Simplify invalid title parsing ......................................................................
[IMPR] Simplify invalid title parsing
This is an alternate implementation of https://gerrit.wikimedia.org/r/#/c/403957/
Change-Id: Ia2456e721472f9bb0386ab15ab1859aa54e63915 --- M pywikibot/page.py 1 file changed, 3 insertions(+), 5 deletions(-)
Approvals: Dvorapa: Looks good to me, but someone else must approve Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 12ccea5..6cff93b 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -5569,13 +5569,11 @@ # * with 'relative' URLs. Forbid them explicitly.
if u'.' in t and ( - t == u'.' or t == u'..' or - t.startswith(u'./') or - t.startswith(u'../') or + t in ('.', '..') or + t.startswith(('./', '../')) or u'/./' in t or u'/../' in t or - t.endswith(u'/.') or - t.endswith(u'/..') + t.endswith(('/.', '/..')) ): raise pywikibot.InvalidTitle( u"(contains . / combinations): '%s'"
pywikibot-commits@lists.wikimedia.org