jenkins-bot has submitted this change and it was merged.
Change subject: Bug 61820. Parameters -start, -end, -titlestart, -tittleend need proper escaping before used in regular expressions. ......................................................................
Bug 61820. Parameters -start, -end, -titlestart, -tittleend need proper escaping before used in regular expressions.
Change-Id: Idb2527fa354b33bf21ee43369c5f7d3ef688010e --- M scripts/pagefromfile.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py index d6dcb34..8c8324b 100644 --- a/scripts/pagefromfile.py +++ b/scripts/pagefromfile.py @@ -283,8 +283,8 @@ yield title, contents
def findpage(self, text): - pageR = re.compile(self.pageStartMarker + "(.*?)" + self.pageEndMarker, re.DOTALL) - titleR = re.compile(self.titleStartMarker + "(.*?)" + self.titleEndMarker) + pageR = re.compile(re.escape(self.pageStartMarker) + "(.*?)" + re.escape(self.pageEndMarker), re.DOTALL) + titleR = re.compile(re.escape(self.titleStartMarker) + "(.*?)" + re.escape(self.titleEndMarker))
location = pageR.search(text) if self.include:
pywikibot-commits@lists.wikimedia.org