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'"

--
To view, visit https://gerrit.wikimedia.org/r/405583
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia2456e721472f9bb0386ab15ab1859aa54e63915
Gerrit-Change-Number: 405583
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: Dalba <dalba.w...@gmail.com>
Gerrit-Reviewer: Dvorapa <dvor...@seznam.cz>
Gerrit-Reviewer: Framawiki <framaw...@tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
Pywikibot-commits mailing list
Pywikibot-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to