Для работы ссылок ВВ [img] [url] Для работы ссылок ВВ [img] [url]
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Для работы ссылок ВВ [img] [url]

Started by lineart, April 23, 2011, 09:52:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lineart

Для работы ссылок ВВ- img, url с использованием РУССКИХ букв, типа
_ttp://www/search-thumbnails-русский.html

Необходимо добавить в файл include/functions.inc.php символы \x7f-\xff
====
function make_clickable($text)
{
    $ret = ' '.$text;
        $ret = preg_replace("#([\n ])([a-z]+?)://([a-z0-9\x7f-\xff\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)#i", "\\1<a href=\"\\2://\\3\" rel=\"external\">\\2://\\3</a>", $ret);
        $ret = preg_replace("#([\n ])www\.([a-z0-9\x7f-\xff\-]+)\.([a-z0-9\x7f-\xff\-.\~]+)((?:/[a-z0-9\x7f-\xff\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" rel=\"external\">www.\\2.\\3\\4</a>", $ret);
        $ret = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
        return substr($ret, 1);
}
====