From 2da966d91861c009ad11f22cb285b7a114a914fd Mon Sep 17 00:00:00 2001 From: nanosimbiot Date: Tue, 5 Jul 2011 19:49:08 +0000 Subject: [PATCH] r91 git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@91 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/includes/bbcode.php | 24 +++++++++++++++++------- upload/triggers/cron_allowed | 1 - 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/upload/includes/bbcode.php b/upload/includes/bbcode.php index 22a9722e2..ed39a975c 100644 --- a/upload/includes/bbcode.php +++ b/upload/includes/bbcode.php @@ -568,7 +568,7 @@ class bbcode $tpl = $this->tpl; $img_url_exp = 'http://[^\s\?&;:=\#\"<>]+?\.(jpg|jpeg|gif|png)'; $email_exp = '[a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+'; - $url_exp = '[\w]+?://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+?'; + $url_exp = '[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+?'; $this->preg = array( '#\[quote="(.+?)"\]#isu' => $tpl['quote_username_open'], @@ -584,9 +584,11 @@ class bbcode '#\[font="([\w\- \']+)"\]#isu' => '', "#\[img\]($img_url_exp)\[/img\]#isu" => $tpl['img'], "#\[img=(left|right)\]($img_url_exp)\[/img\]\s*#isu" => $tpl['img_aligned'], - "#\[url\]($url_exp)\[/url\]#isu" => '$1', - "#\[url=($url_exp)\]([^?\n\r\t].*?)\[/url\]#isu" => '$2', - "#\[email\]($email_exp)\[/email\]#isu" => '$1', + "#\[url\](https?://$url_exp)\[/url\]#isu" => '$1', + "#\[url\](www\.$url_exp)\[/url\]#isu" => '$1', + "#\[url=(https?://$url_exp)\]([^?\n\t].*?)\[/url\]#isu" => '$2', + "#\[url=(www\.$url_exp)\]([^?\n\t].*?)\[/url\]#isu" => '$2', + "#\[email\]($email_exp)\[/email\]#isu" => '$1', ); $this->str = array( @@ -774,14 +776,22 @@ class bbcode { global $bb_cfg; - $url_regexp = "#(? $max_len) ? mb_substr($href, 0, $max_len - 19) .'...'. mb_substr($href, -16) : $href; + $name = (mb_strlen($href, 'UTF-8') > $max_len) ? mb_substr($href, 0, $max_len - 19) .'...'. mb_substr($href, -16) : $href; return "$name"; } diff --git a/upload/triggers/cron_allowed b/upload/triggers/cron_allowed index 263001f11..e69de29bb 100644 --- a/upload/triggers/cron_allowed +++ b/upload/triggers/cron_allowed @@ -1 +0,0 @@ -LQ7Ntw6K5GjKm3bGkYEK \ No newline at end of file