[COMPONENT][Link] Fix mistake where only the first URL was matched and the match included the preceeding whitespace character
This commit is contained in:
parent
ebf675ec59
commit
364c14ef2c
@ -42,8 +42,8 @@ class Link extends Component
|
|||||||
{
|
{
|
||||||
if (Common::config('attachments', 'process_links')) {
|
if (Common::config('attachments', 'process_links')) {
|
||||||
$matched_urls = [];
|
$matched_urls = [];
|
||||||
preg_match($this->getURLRegex(), $content, $matched_urls);
|
preg_match_all($this->getURLRegex(), $content, $matched_urls);
|
||||||
$matched_urls = array_unique($matched_urls);
|
$matched_urls = array_unique($matched_urls[1]);
|
||||||
foreach ($matched_urls as $match) {
|
foreach ($matched_urls as $match) {
|
||||||
try {
|
try {
|
||||||
$link_id = Entity\Link::getOrCreate($match)->getId();
|
$link_id = Entity\Link::getOrCreate($match)->getId();
|
||||||
|
Loading…
Reference in New Issue
Block a user