mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix linkify to work with with ip addresses (#8226)
* fix linkify to work with with ip addresses * update tests
This commit is contained in:
@ -185,7 +185,7 @@ function toner2colour($descr, $percent)
|
||||
*/
|
||||
function linkify($text)
|
||||
{
|
||||
$regex = "/(http|https|ftp|ftps):\/\/[a-z0-9\-.]+\.[a-z]{2,5}(\/\S*)?/i";
|
||||
$regex = "#(http|https|ftp|ftps)://[a-z0-9\-.]*[a-z0-9\-]+(/\S*)?#i";
|
||||
|
||||
return preg_replace($regex, '<a href="$0">$0</a>', $text);
|
||||
}
|
||||
|
Reference in New Issue
Block a user