From 810439438d9c97350ab9ce57d9ef339535037bac Mon Sep 17 00:00:00 2001 From: Exile Date: Sun, 31 Aug 2014 16:43:32 +0400 Subject: [PATCH] Revert previous MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Откат предыдущего коммита. Все было ок. --- upload/includes/bbcode.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/upload/includes/bbcode.php b/upload/includes/bbcode.php index 6cf723751..c691b7e69 100644 --- a/upload/includes/bbcode.php +++ b/upload/includes/bbcode.php @@ -576,7 +576,7 @@ class bbcode // [url] $url_exp = '[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+?'; - $text = preg_replace_callback("#\[url\]((https?://)?$url_exp)\[/url\]#isu", array(&$this, 'url_callback'), $text); + $text = preg_replace_callback("#\[url\]((?:https?://)?$url_exp)\[/url\]#isu", array(&$this, 'url_callback'), $text); $text = preg_replace_callback("#\[url\](www\.$url_exp)\[/url\]#isu", array(&$this, 'url_callback'), $text); $text = preg_replace_callback("#\[url=(https?://$url_exp)\]([^?\n\t].*?)\[/url\]#isu", array(&$this, 'url_callback'), $text); $text = preg_replace_callback("#\[url=(www\.$url_exp)\]([^?\n\t].*?)\[/url\]#isu", array(&$this, 'url_callback'), $text); @@ -704,10 +704,7 @@ class bbcode $url = trim($m[1]); $url_name = (isset($m[2])) ? trim($m[2]) : $url; - - if (!preg_match("#^http://#", $url)) { - $url = 'http://' . $url; - } + if (!preg_match("#^http://#", $url)) $url = 'http://' . $url; if (in_array(parse_url($url, PHP_URL_HOST), $bb_cfg['nofollow']['allowed_url']) || $bb_cfg['nofollow']['disabled']) {