From 0616f5230caa9e5c8b7c1fcd9552dcae1c5882ab Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 2 May 2021 17:53:11 +0000 Subject: [PATCH] Only detect http links --- src/Content/PageInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content/PageInfo.php b/src/Content/PageInfo.php index 21f32cd3c3..d3b38336b5 100644 --- a/src/Content/PageInfo.php +++ b/src/Content/PageInfo.php @@ -257,11 +257,11 @@ class PageInfo $body = preg_replace("/([#@!])\[url\=(.*?)\](.*?)\[\/url\]/ism", '', $body); // Search for pure links - preg_match("/\[url\](.*?)\[\/url\]/ism", $body, $matches); + preg_match("/\[url\](https?:.*?)\[\/url\]/ism", $body, $matches); if (!$matches) { // Search for links with descriptions - preg_match("/\[url\=(.*?)\].*?\[\/url\]/ism", $body, $matches); + preg_match("/\[url\=(https?:.*?)\].*?\[\/url\]/ism", $body, $matches); } if (!$matches && $searchNakedUrls) {