diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 917b6c1a0..7f526a1f7 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -139,7 +139,9 @@ switch($this->request['type']) } } DB()->query("UPDATE ". BB_POSTS_TEXT ." SET post_text = '". DB()->escape($text) ."' WHERE post_id = $post_id LIMIT 1"); - add_search_words($post_id, stripslashes($text), stripslashes($post['topic_title'])); + $s_text = str_replace('\n', "\n", $text); + $s_topic_title = str_replace('\n', "\n", $post['topic_title']); + add_search_words($post_id, stripslashes($s_text), stripslashes($s_topic_title)); update_post_html(array( 'post_id' => $post_id, 'post_text' => $text, @@ -285,7 +287,9 @@ switch($this->request['type']) update_post_stats('reply', $post, $post['forum_id'], $topic_id, $post_id, $userdata['user_id']); - add_search_words($post_id, stripslashes($message), stripslashes($post['topic_title'])); + $s_message = str_replace('\n', "\n", $message); + $s_topic_title = str_replace('\n', "\n", $post['topic_title']); + add_search_words($post_id, stripslashes($s_message), stripslashes($s_topic_title)); update_post_html(array( 'post_id' => $post_id, 'post_text' => $message, diff --git a/upload/config.php b/upload/config.php index d002239b3..f82f076fa 100644 --- a/upload/config.php +++ b/upload/config.php @@ -58,7 +58,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do $bb_cfg['tp_version'] = '2.5 Beta'; $bb_cfg['tp_release_date'] = '14-11-2012'; -$bb_cfg['tp_release_state'] = 'R475'; +$bb_cfg['tp_release_state'] = 'R476'; // Database $charset = 'utf8'; diff --git a/upload/includes/bbcode.php b/upload/includes/bbcode.php index e5f99bc61..21e50d1c1 100644 --- a/upload/includes/bbcode.php +++ b/upload/includes/bbcode.php @@ -343,7 +343,7 @@ function strip_bbcode ($message, $stripquotes = true, $fast_and_dirty = false, $ $message = str_replace($m[0], $m[2], $message); } - $replace = array('[*]', '[hr]', '[br]'); + $replace = array('[*]', '[hr]', '[br]', '[align=center]', '[align=left]', '[align=right]'); $message = str_replace($replace, ' ', $message); } @@ -365,6 +365,9 @@ function extract_search_words ($text) $text = preg_replace('/(\w*?)&#?[0-9a-z]+;(\w*?)/iu', '', $text); // Remove URL's ((www|ftp)\.[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]*?) $text = preg_replace('#\b[a-z0-9]+://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+(/[0-9a-z\?\.%_\-\+=&/]+)?#u', ' ', $text); + $text = str_replace('[url=', ' ', $text); + $text = str_replace('?', ' ', $text); + $text = str_replace('!', ' ', $text); $text = strip_bbcode($text); @@ -372,7 +375,7 @@ function extract_search_words ($text) $text = preg_replace('#[.,:;]#u', ' ', $text); // short & long words - $text = preg_replace('#(?<=^|\s)(\S{1,'.$min_word_len.'}|\S{'.$max_word_len.',}|\W*)(?=$|\s)#', ' ', $text); + $text = preg_replace('#(?<=^|\s)(\S{1,'.$min_word_len.'}|\S{'.$max_word_len.',}|\W*)(?=$|\s)#u', ' ', $text); $text = remove_stopwords($text); # $text = replace_synonyms($text); @@ -508,7 +511,7 @@ class bbcode "#\[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', + "#\[email\]($email_exp)\[/email\]#isu" => '$1', "#\[qpost=([0-9]*)\]#isu" => '$1', ); diff --git a/upload/includes/functions_post.php b/upload/includes/functions_post.php index 28bb90363..2c6f1aaf6 100644 --- a/upload/includes/functions_post.php +++ b/upload/includes/functions_post.php @@ -206,7 +206,9 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_ if ($userdata['user_id'] != BOT_UID) { - add_search_words($post_id, stripslashes($post_message), stripslashes($post_subject)); + $s_post_message = str_replace('\n', "\n", $post_message); + $s_post_subject = str_replace('\n', "\n", $post_subject); + add_search_words($post_id, stripslashes($s_post_message), stripslashes($s_post_subject)); } update_post_html(array(