From f6a947fcc7dca468d2764eb04a9c63c9cbc0a6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Rodrigues?= Date: Tue, 9 Jul 2019 16:00:33 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX:=20padr=C3=B5es=20de=20links?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/base/templatetags/common_tags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index b9194a1c6..a7ab3ec21 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -233,13 +233,13 @@ def is_video_url(value): def youtube_url(value): # Test if YouTube video # tested on https://pythex.org/ - youtube_pattern = "^(http://?|https://?www\.?youtube\.com/watch\?v=)" + youtube_pattern = "^((http://|https://)?www\.?youtube\.com/watch\?v=)" r = re.findall(youtube_pattern, value) return True if r else False @register.filter def facebook_url(value): - facebook_pattern = "^(http://?|https://?(www?|pt-br?)\.facebook\.com/(.*?)/videos/(.*?))" + facebook_pattern = "^((http://|https://)?(www?|pt-br?)\.facebook\.com/(.*?)/videos/(.*?))" r = re.findall(facebook_pattern, value) return True if r else False