Экспорт. Коммит №22. Кириллица в ссылках. _Xz_. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@23 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
glix08 2011-06-27 21:34:28 +00:00
commit f6343c444a
2 changed files with 8 additions and 8 deletions

View file

@ -277,9 +277,8 @@ class ajax_common
$message = (string) $this->request['message']; $message = (string) $this->request['message'];
if(!trim($message)) $this->ajax_die($lang['EMPTY_MESSAGE']); if(!trim($message)) $this->ajax_die($lang['EMPTY_MESSAGE']);
$message = bbcode2html(DB()->escape($message)); $message = bbcode2html($message);
$message = str_replace('\n', '<div></div>', $message); $this->response['html'] = $message;
$this->response['html'] = $message;
} }
function change_tor_status () function change_tor_status ()

View file

@ -583,8 +583,9 @@ class bbcode
function init_replacements () function init_replacements ()
{ {
$tpl = $this->tpl; $tpl = $this->tpl;
$url_exp = '[\w\#$%&~/.\-;:=?@\[\]+]+?'; $url_exp = '[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+?';
$img_url_exp = 'http://[^\s\?&;:=\#\"<>]+?\.(jpg|jpeg|gif|png)'; $img_url_exp = 'http://[^\s\?&;:=\#\"<>]+?\.(jpg|jpeg|gif|png)';
$email_exp = '[a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+'; $email_exp = '[a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+';
$this->preg = array( $this->preg = array(
@ -602,10 +603,10 @@ class bbcode
"#\[img\]($img_url_exp)\[/img\]#i" => $tpl['img'], "#\[img\]($img_url_exp)\[/img\]#i" => $tpl['img'],
"#\[img=(left|right)\]($img_url_exp)\[/img\]\s*#i" => $tpl['img_aligned'], "#\[img=(left|right)\]($img_url_exp)\[/img\]\s*#i" => $tpl['img_aligned'],
"#\[email\]($email_exp)\[/email\]#i" => '<a href="mailto:$1">$1</a>', "#\[email\]($email_exp)\[/email\]#i" => '<a href="mailto:$1">$1</a>',
"#\[url\](https?://$url_exp)\[/url\]#i" => '<a href="$1" class="postLink">$1</a>', "#\[url\](https?://$url_exp)\[/url\]#iu" => '<a href="$1" class="postLink">$1</a>',
"#\[url\](www\.$url_exp)\[/url\]#i" => '<a href="http://$1" class="postLink">$1</a>', "#\[url\](www\.$url_exp)\[/url\]#iu" => '<a href="http://$1" class="postLink">$1</a>',
"#\[url=(https?://$url_exp)\]([^?\n\t].*?)\[/url\]#i" => '<a href="$1" class="postLink">$2</a>', "#\[url=(https?://$url_exp)\]([^?\n\t].*?)\[/url\]#iu" => '<a href="$1" class="postLink">$2</a>',
"#\[url=(www\.$url_exp)\]([^?\n\t].*?)\[/url\]#i" => '<a href="http://$1" class="postLink">$2</a>', "#\[url=(www\.$url_exp)\]([^?\n\t].*?)\[/url\]#iu" => '<a href="http://$1" class="postLink">$2</a>',
); );
$this->str = array( $this->str = array(