Remove possible (.) from end of url link

This commit is contained in:
Retro_Guy 2021-06-15 07:42:23 +00:00
parent 59a21be4a0
commit 50993b3ab7

View File

@ -885,6 +885,7 @@ function html_parse($text) {
$word=$words[$i]; $word=$words[$i];
if(preg_match('/https?\:\/\/[^\",]+/i', $word)) { if(preg_match('/https?\:\/\/[^\",]+/i', $word)) {
$nlink = preg_replace('/(\&lt|\&gt);/', '', $word); $nlink = preg_replace('/(\&lt|\&gt);/', '', $word);
$nlink = rtrim($nlink, '.');
$nword = '<a '.$target.' href="'.$nlink.'">'.$word.'</a>'; $nword = '<a '.$target.' href="'.$nlink.'">'.$word.'</a>';
if($nword!=$word) { if($nword!=$word) {
$word=$nword; $word=$nword;