X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FLinkUtils.php;h=267e62cde41f9193e384cede8665311fe76ccd6e;hb=b7fdbfa789a95cd0eeaf452fd512871dcdffe55c;hp=cf58f8083355af37e0a9271cf1168823252708dc;hpb=9cf93bcfc53c36e0dd59fcfc717ac483ee74b35a;p=github%2Fshaarli%2FShaarli.git diff --git a/application/LinkUtils.php b/application/LinkUtils.php index cf58f808..267e62cd 100644 --- a/application/LinkUtils.php +++ b/application/LinkUtils.php @@ -89,7 +89,9 @@ function count_private($links) { $cpt = 0; foreach ($links as $link) { - $cpt = $link['private'] == true ? $cpt + 1 : $cpt; + if ($link['private']) { + $cpt += 1; + } } return $cpt; @@ -107,7 +109,7 @@ function count_private($links) */ function text2clickable($text, $redirector = '') { - $regex = '!(((?:https?|ftp|file)://|apt:|magnet:)\S+[[:alnum:]]/?)!si'; + $regex = '!(((?:https?|ftp|file)://|apt:|magnet:)\S+[a-z0-9\(\)]/?)!si'; if (empty($redirector)) { return preg_replace($regex, '$1', $text);