From 0e37a994d2f7801f16a6c38bc4e0fbefcd4b482e Mon Sep 17 00:00:00 2001 From: nanosimbiot Date: Tue, 5 Jul 2011 18:32:51 +0000 Subject: [PATCH] r90 git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@90 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/config.php | 2 +- upload/includes/bbcode.php | 23 ++++----------- upload/includes/init_bb.php | 4 --- upload/posting.php | 10 +++---- upload/redirect.php | 27 ------------------ upload/templates/default/redirect.tpl | 40 --------------------------- upload/triggers/cron_allowed | 1 + 7 files changed, 13 insertions(+), 94 deletions(-) delete mode 100644 upload/redirect.php delete mode 100644 upload/templates/default/redirect.tpl diff --git a/upload/config.php b/upload/config.php index 39a783369..b1cc86420 100644 --- a/upload/config.php +++ b/upload/config.php @@ -57,7 +57,7 @@ $bb_cfg['css_ver'] = 1; // Increase number of revision after update $bb_cfg['tp_version'] = '2.0.2'; -$bb_cfg['tp_release_state'] = 'TP II r89'; +$bb_cfg['tp_release_state'] = 'TP II r90'; $bb_cfg['tp_release_date'] = '05-07-2011'; $bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger diff --git a/upload/includes/bbcode.php b/upload/includes/bbcode.php index 7ea7419ac..22a9722e2 100644 --- a/upload/includes/bbcode.php +++ b/upload/includes/bbcode.php @@ -568,6 +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\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+?'; $this->preg = array( '#\[quote="(.+?)"\]#isu' => $tpl['quote_username_open'], @@ -583,6 +584,8 @@ 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', ); @@ -771,17 +774,14 @@ class bbcode { global $bb_cfg; - $url_regexp = array(); - $url_regexp[] = "#\[url\]([\w]+?://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+?)\[/url\]#isu"; - $url_regexp[] = "#\[url=([\w]+?://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#isu"; - $url_regexp[] = "#(? $max_len) ? mb_substr($href, 0, $max_len - 19) .'...'. mb_substr($href, -16) : $href; - if(mb_strlen($name, 'UTF-8') > $max_len) - { - $name = mb_substr($name, 0, $max_len - 19, 'UTF-8') .'...'. mb_substr($name, -16, 'UTF-8'); - } - - if(!preg_match("#{$bb_cfg['server_name']}#", $href)) - { - return ''. $name .''; - } return "$name"; } diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php index 6ad2a3b57..dc5f345ab 100644 --- a/upload/includes/init_bb.php +++ b/upload/includes/init_bb.php @@ -507,10 +507,6 @@ function vdump ($var, $title = '') function htmlCHR ($txt, $double_encode = false, $quote_style = ENT_QUOTES, $charset = 'UTF-8') { - if (is_array($txt)) - { - log_request('htmlCHR'); - } return (string) htmlspecialchars($txt, $quote_style, $charset, $double_encode); } diff --git a/upload/posting.php b/upload/posting.php index ad792444b..f819356b8 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -489,11 +489,11 @@ else if ( ($submit || $confirm) && !$topic_has_new_posts ) case 'editpost': case 'newtopic': case 'reply': - $username = ( !empty($_POST['username']) ) ? $_POST['username'] : ''; - $subject = ( !empty($_POST['subject']) ) ? trim($_POST['subject']) : ''; - $message = ( !empty($_POST['message']) ) ? $_POST['message'] : ''; - $poll_title = ( isset($_POST['poll_title']) && $is_auth['auth_pollcreate'] ) ? $_POST['poll_title'] : ''; - $poll_options = ( isset($_POST['poll_option_text']) && $is_auth['auth_pollcreate'] ) ? $_POST['poll_option_text'] : ''; + $username = ( !empty($_POST['username']) ) ? clean_username($_POST['username']) : ''; + $subject = ( !empty($_POST['subject']) ) ? clean_title($_POST['subject']) : ''; + $message = ( !empty($_POST['message']) ) ? prepare_message($_POST['message']) : ''; + $poll_title = ( isset($_POST['poll_title']) && $is_auth['auth_pollcreate'] ) ? clean_title($_POST['poll_title']) : ''; + $poll_options = ( isset($_POST['poll_option_text']) && $is_auth['auth_pollcreate'] ) ? clean_title($_POST['poll_option_text']) : ''; $poll_length = ( isset($_POST['poll_length']) && $is_auth['auth_pollcreate'] ) ? $_POST['poll_length'] : ''; prepare_post($mode, $post_data, $error_msg, $username, $subject, $message, $poll_title, $poll_options, $poll_length); diff --git a/upload/redirect.php b/upload/redirect.php deleted file mode 100644 index 107b3bd90..000000000 --- a/upload/redirect.php +++ /dev/null @@ -1,27 +0,0 @@ -session_start(); -$url = (string) request_var('url', ''); -$time = 15; - -$url = urldecode($url); - -if(!$url) -{ - meta_refresh(BB_ROOT, 0); - bb_die ('Неверная ссылка'); -} - -meta_refresh($url, $time); - -$template->assign_vars(array( - 'URL' => $url, - 'URL_TITLE' => str_short($url, 70), - 'PAGE_TITLE' => 'Переадресация...', - 'TIME' => $time, -)); - -print_page('redirect.tpl'); diff --git a/upload/templates/default/redirect.tpl b/upload/templates/default/redirect.tpl deleted file mode 100644 index 294561100..000000000 --- a/upload/templates/default/redirect.tpl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - -
-

{PAGE_TITLE}

- -
-
-

{PAGE_TITLE}

-
-
- Вы покидаете {SITENAME} и переходите на {URL_TITLE}. -
- Вы будете переадресованы через {TIME} секунд. -
- Внимание! Администрация не несет отвественности за сайт на которой вы переходите. -
-
-
- - diff --git a/upload/triggers/cron_allowed b/upload/triggers/cron_allowed index e69de29bb..263001f11 100644 --- a/upload/triggers/cron_allowed +++ b/upload/triggers/cron_allowed @@ -0,0 +1 @@ +LQ7Ntw6K5GjKm3bGkYEK \ No newline at end of file