Skip to content

Commit

Permalink
only replace links that are not in quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jul 14, 2023
1 parent 00985fa commit 78258e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Thruk/Utils/Filter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ sub replace_links {
/gxme;

# standard text link: https://link.domain/...
$txt =~ s/(https?:\/\/(?:www\.)?[-a-zA-Z0-9\@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()\@:%_\+.~#?&\/=]*))(\s|<br>|$)
$txt =~ s/(?:^|\s)(https?:\/\/(?:www\.)?[-a-zA-Z0-9\@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()\@:%_\+.~#?&\/=]*))(\s|<br>|$)
/<a class="link" href="$1" target="_blank"><i class="uil uil-external-link-alt text-sm"><\/i>$1<\/a>$2
/gmx;

Expand Down

0 comments on commit 78258e2

Please sign in to comment.