From 364c14ef2cbc1a767ad5d955737a7e74f9c603f0 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sun, 24 Oct 2021 21:30:47 +0100 Subject: [PATCH] [COMPONENT][Link] Fix mistake where only the first URL was matched and the match included the preceeding whitespace character --- components/Link/Link.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Link/Link.php b/components/Link/Link.php index e4815e0d2b..305baa35cf 100644 --- a/components/Link/Link.php +++ b/components/Link/Link.php @@ -42,8 +42,8 @@ class Link extends Component { if (Common::config('attachments', 'process_links')) { $matched_urls = []; - preg_match($this->getURLRegex(), $content, $matched_urls); - $matched_urls = array_unique($matched_urls); + preg_match_all($this->getURLRegex(), $content, $matched_urls); + $matched_urls = array_unique($matched_urls[1]); foreach ($matched_urls as $match) { try { $link_id = Entity\Link::getOrCreate($match)->getId();