diff --git a/phpBB/phpbb/textreparser/plugins/poll_title.php b/phpBB/phpbb/textreparser/plugins/poll_title.php index 76d30655c9..5ca8bb063b 100644 --- a/phpBB/phpbb/textreparser/plugins/poll_title.php +++ b/phpBB/phpbb/textreparser/plugins/poll_title.php @@ -34,7 +34,7 @@ class poll_title extends \phpbb\textreparser\row_based_plugin $sql = 'SELECT t.topic_id AS id, t.poll_title AS text, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.bbcode_uid FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p WHERE t.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .' - AND t.poll_max_options > 0 + AND t.poll_start > 0 AND p.post_id = t.topic_first_post_id'; return $sql; diff --git a/tests/text_reparser/plugins/fixtures/polls.xml b/tests/text_reparser/plugins/fixtures/polls.xml index 2960d640a9..5247fb906d 100644 --- a/tests/text_reparser/plugins/fixtures/polls.xml +++ b/tests/text_reparser/plugins/fixtures/polls.xml @@ -44,55 +44,66 @@ topic_id topic_first_post_id poll_title + poll_start 1 1 This row should be [b]ignored[/b] + 1 2 1 [b]Not bold[/b] :) http://example.org + 1 3 2 [b:abcd1234]Bold[/b:abcd1234] :) http://example.org + 1 4 3 :) http://example.org]]> + 1 5 4 http://example.org]]> + 1 6 2 + 1 7 1 + 1 8 2 + 1 9 1 + 1 1000 1 This row should be [b]ignored[/b] + 1