diff --git a/inc/html.php b/inc/html.php index dcf8332..a078c33 100644 --- a/inc/html.php +++ b/inc/html.php @@ -95,12 +95,13 @@ function _makeLinksClickable($matches) { if (!isset($matches[1])) { return ''; } - $url = htmlentities($matches[1], ENT_QUOTES); - return '' . $url . ''; + $url = str_replace('&', '&', htmlspecialchars($matches[1], ENT_QUOTES)); + $text = htmlentities($matches[1], ENT_QUOTES); + return '' . $text . ''; } function makeLinksClickable($text) { - $text = preg_replace_callback('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%\!_+.,~#?&;\'/=]+)!i', '_makeLinksClickable', $text); + $text = preg_replace_callback('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@%\!_+.,~#?&;:|\'/=]+)!i', '_makeLinksClickable', $text); $text = preg_replace('/\(\(.*)\)\<\/a>/i', '($2)', $text); $text = preg_replace('/\(.*)\.\<\/a>/i', '$2.', $text); $text = preg_replace('/\(.*)\,\<\/a>/i', '$2,', $text);