diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 0f9c36bb09..f1a9dd1830 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1757,7 +1757,7 @@ function get_schema_struct() 'topic_moved_id' => array('UINT', 0), 'topic_bumped' => array('BOOL', 0), 'topic_bumper' => array('UINT', 0), - 'poll_title' => array('XSTEXT_UNI', ''), + 'poll_title' => array('STEXT_UNI', ''), 'poll_start' => array('TIMESTAMP', 0), 'poll_length' => array('TIMESTAMP', 0), 'poll_max_options' => array('TINT:4', 1), 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; } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 201629e7b1..363a90e5d8 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -317,7 +317,7 @@ $database_update_info = array( 'seed' => array('UINT:10', 0), ), SESSIONS_TABLE => array( - 'session_forwarded_for' => array('VCHAR:255', 0), + 'session_forwarded_for' => array('VCHAR:255', ''), ), ), 'change_columns' => array( @@ -351,6 +351,17 @@ $database_update_info = array( ), ), ), + // Changes from 3.0.b5 to the next version + '3.0.b5' => array( + 'change_columns' => array( + TOPICS_TABLE => array( + 'poll_title' => array('STEXT_UNI', ''), + ), + SESSIONS_TABLE => array( + 'session_forwarded_for' => array('VCHAR:255', ''), + ), + ), + ), ); // Determine mapping database type diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index dd3e4af9d2..9ab8594c01 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -1284,7 +1284,7 @@ CREATE TABLE phpbb_topics ( topic_moved_id INTEGER DEFAULT 0 NOT NULL, topic_bumped INTEGER DEFAULT 0 NOT NULL, topic_bumper INTEGER DEFAULT 0 NOT NULL, - poll_title VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + poll_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, poll_start INTEGER DEFAULT 0 NOT NULL, poll_length INTEGER DEFAULT 0 NOT NULL, poll_max_options INTEGER DEFAULT 1 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 7f33783072..9d4eb55505 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1481,7 +1481,7 @@ CREATE TABLE [phpbb_topics] ( [topic_moved_id] [int] DEFAULT (0) NOT NULL , [topic_bumped] [int] DEFAULT (0) NOT NULL , [topic_bumper] [int] DEFAULT (0) NOT NULL , - [poll_title] [varchar] (100) DEFAULT ('') NOT NULL , + [poll_title] [varchar] (255) DEFAULT ('') NOT NULL , [poll_start] [int] DEFAULT (0) NOT NULL , [poll_length] [int] DEFAULT (0) NOT NULL , [poll_max_options] [int] DEFAULT (1) NOT NULL , diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 7ade8bd1a4..bf884e1ed4 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -900,7 +900,7 @@ CREATE TABLE phpbb_topics ( topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - poll_title varchar(100) DEFAULT '' NOT NULL, + poll_title varchar(255) DEFAULT '' NOT NULL, poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL, poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL, poll_max_options tinyint(4) DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 8634dcd1fe..970006a7c8 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1666,7 +1666,7 @@ CREATE TABLE phpbb_topics ( topic_moved_id number(8) DEFAULT '0' NOT NULL, topic_bumped number(1) DEFAULT '0' NOT NULL, topic_bumper number(8) DEFAULT '0' NOT NULL, - poll_title varchar2(300) DEFAULT '' , + poll_title varchar2(765) DEFAULT '' , poll_start number(11) DEFAULT '0' NOT NULL, poll_length number(11) DEFAULT '0' NOT NULL, poll_max_options number(4) DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index d0005a16a7..e1dea496cf 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -1148,7 +1148,7 @@ CREATE TABLE phpbb_topics ( topic_moved_id INT4 DEFAULT '0' NOT NULL CHECK (topic_moved_id >= 0), topic_bumped INT2 DEFAULT '0' NOT NULL CHECK (topic_bumped >= 0), topic_bumper INT4 DEFAULT '0' NOT NULL CHECK (topic_bumper >= 0), - poll_title varchar(100) DEFAULT '' NOT NULL, + poll_title varchar(255) DEFAULT '' NOT NULL, poll_start INT4 DEFAULT '0' NOT NULL CHECK (poll_start >= 0), poll_length INT4 DEFAULT '0' NOT NULL CHECK (poll_length >= 0), poll_max_options INT2 DEFAULT '1' NOT NULL, diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index d5e8450699..0724918a2e 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -141,6 +141,8 @@ $lang = array_merge($lang, array( 'POLL_OPTIONS' => 'Poll options', 'POLL_OPTIONS_EXPLAIN' => 'Place each option on a new line. You may enter up to %d options', 'POLL_QUESTION' => 'Poll question', + 'POLL_TITLE_TOO_LONG' => 'The poll title must contain fewer than 100 characters', + 'POLL_TITLE_COMP_TOO_LONG' => 'The parsed size of your poll title is too large, consider removing BBCodes or smilies', 'POLL_VOTE_CHANGE' => 'Allow re-voting', 'POLL_VOTE_CHANGE_EXPLAIN' => 'If enabled users are able to change their vote.', 'POSTED_ATTACHMENTS' => 'Posted attachments',