From 64b2dc23578c1d7637d21b8b398659226f77b1bb Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Fri, 10 May 2019 17:30:48 -0300 Subject: [PATCH 1/2] Allow data URLs in isURL/getURL helpers --- app/utils/lib/isURL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/lib/isURL.js b/app/utils/lib/isURL.js index 325c34b906c7..cb3f60ecf5c9 100644 --- a/app/utils/lib/isURL.js +++ b/app/utils/lib/isURL.js @@ -1 +1 @@ -export const isURL = (str) => /^https?:\/\//.test(str); +export const isURL = (str) => /^(https?|data):\/\//.test(str); From 0f7da693f5ace90a8d1238e3ba7b555516821c9a Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Fri, 10 May 2019 19:14:42 -0300 Subject: [PATCH 2/2] Fix regular expression --- app/utils/lib/isURL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/lib/isURL.js b/app/utils/lib/isURL.js index cb3f60ecf5c9..1a8a95aeec67 100644 --- a/app/utils/lib/isURL.js +++ b/app/utils/lib/isURL.js @@ -1 +1 @@ -export const isURL = (str) => /^(https?|data):\/\//.test(str); +export const isURL = (str) => /^(https?:\/\/|data:)/.test(str);