From 313c001a63e8b157d2e3db827c301c3fc19dc557 Mon Sep 17 00:00:00 2001 From: Mattia Succurro Date: Tue, 15 Oct 2019 16:32:36 +0200 Subject: [PATCH] Fixed url regex --- CHANGELOG.md | 1 + app.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d64fc0..58ee3f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Rewritten `enrich` filter, correcting a serious security flaw. The new filter uses a tokenizer and escapes all non-markup text. Plus, now the `+` of the mention is visible, but weakened; newlines are now visible in the message. * Now you can edit or change privacy to messages after they are published. After a message it's edited, the date and time of the message is changed. * Fixed a bug when uploading. +* Moved the site name, previously hard-coded into templates, into `config.py`. ## 0.4.0 diff --git a/app.py b/app.py index 04fb230..b7c92da 100644 --- a/app.py +++ b/app.py @@ -620,7 +620,7 @@ def username_availability(username): _enrich_symbols = [ (r'\n', 'NEWLINE'), (r'https?://(?:[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*|\[[A-Fa-f0-9:]+\])' - r'(?::\d+)?(?:/.*)?(?:\?.*)?(?:#.*)?', 'URL'), + r'(?::\d+)?(?:/[^\s]*)?(?:\?[^\s]*)?(?:#[^\s]*)?', 'URL'), (_mention_re, 'MENTION'), (r'[^h\n+]+', 'TEXT'), (r'.', 'TEXT')