Xqt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405583 )

Change subject: [IMPR] Simplify invalid title parsing
......................................................................

[IMPR] Simplify invalid title parsing

This is an alternat implementation of
https://gerrit.wikimedia.org/r/#/c/403957/

Change-Id: Ia2456e721472f9bb0386ab15ab1859aa54e63915
---
M pywikibot/page.py
1 file changed, 3 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/83/405583/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 0ca875bc..7863fb1 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -5554,13 +5554,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(('/.', '/..')) or
         ):
             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-MessageType: newchange
Gerrit-Change-Id: Ia2456e721472f9bb0386ab15ab1859aa54e63915
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to