Fixed url regex

This commit is contained in:
Yusur 2019-10-15 16:32:36 +02:00
parent 01cb4354e0
commit 313c001a63
2 changed files with 2 additions and 1 deletions

View file

@ -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. * 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. * 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. * Fixed a bug when uploading.
* Moved the site name, previously hard-coded into templates, into `config.py`.
## 0.4.0 ## 0.4.0

2
app.py
View file

@ -620,7 +620,7 @@ def username_availability(username):
_enrich_symbols = [ _enrich_symbols = [
(r'\n', 'NEWLINE'), (r'\n', 'NEWLINE'),
(r'https?://(?:[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*|\[[A-Fa-f0-9:]+\])' (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'), (_mention_re, 'MENTION'),
(r'[^h\n+]+', 'TEXT'), (r'[^h\n+]+', 'TEXT'),
(r'.', 'TEXT') (r'.', 'TEXT')