parent
013270c532
commit
340b66fe1b
1 changed files with 4 additions and 3 deletions
|
@ -95,12 +95,13 @@ function _makeLinksClickable($matches) {
|
|||
if (!isset($matches[1])) {
|
||||
return '';
|
||||
}
|
||||
$url = htmlentities($matches[1], ENT_QUOTES);
|
||||
return '<a href="' . $url . '" target="_blank">' . $url . '</a>';
|
||||
$url = str_replace('&', '&', htmlspecialchars($matches[1], ENT_QUOTES));
|
||||
$text = htmlentities($matches[1], ENT_QUOTES);
|
||||
return '<a href="' . $url . '" target="_blank">' . $text . '</a>';
|
||||
}
|
||||
|
||||
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 href\=\"(.*)\)"\ target\=\"\_blank\">(.*)\)\<\/a>/i', '(<a href="$1" target="_blank">$2</a>)', $text);
|
||||
$text = preg_replace('/\<a href\=\"(.*)\."\ target\=\"\_blank\">(.*)\.\<\/a>/i', '<a href="$1" target="_blank">$2</a>.', $text);
|
||||
$text = preg_replace('/\<a href\=\"(.*)\,"\ target\=\"\_blank\">(.*)\,\<\/a>/i', '<a href="$1" target="_blank">$2</a>,', $text);
|
||||
|
|
Loading…
Reference in a new issue