From 42f3115763fa2496f552a25305266283152c209b Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 22 Feb 2007 19:58:05 +0000 Subject: #8244 - cleaned up the TRUNCATE/DELETE FROM in the native search backend - fixed an imporoper default value on some upgrades git-svn-id: file:///svn/phpbb/trunk@7036 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/message_parser.php | 8 ++++++++ phpBB/includes/search/fulltext_native.php | 24 ++---------------------- 2 files changed, 10 insertions(+), 22 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index e2c0b37fe7..d358ec8f48 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1507,7 +1507,15 @@ class parse_message extends bbcode_firstpass } else { + if (utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message)) > 100) + { + $this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG']; + } $poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false); + if (strlen($poll['poll_title']) > 255) + { + $this->warn_msg[] = $user->lang['POLL_TITLE_COMP_TOO_LONG']; + } } $this->message = $tmp_message; diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index bd197feede..30dc779078 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1271,33 +1271,13 @@ class fulltext_native extends search_backend case 'sqlite': case 'firebird': $db->sql_query('DELETE FROM ' . SEARCH_WORDLIST_TABLE); - break; - - default: - $db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDLIST_TABLE); - break; - } - - switch ($db->sql_layer) - { - case 'sqlite': - case 'firebird': $db->sql_query('DELETE FROM ' . SEARCH_WORDMATCH_TABLE); - break; - - default: - $db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDMATCH_TABLE); - break; - } - - switch ($db->sql_layer) - { - case 'sqlite': - case 'firebird': $db->sql_query('DELETE FROM ' . SEARCH_RESULTS_TABLE); break; default: + $db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDLIST_TABLE); + $db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDMATCH_TABLE); $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); break; } -- cgit v1.2.1