diff options
author | Marc Alexander <admin@m-a-styles.de> | 2018-01-19 12:20:54 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2018-01-19 12:20:54 +0100 |
commit | adc75b700f0cf3d6d47689c00932fd1f41bc58e9 (patch) | |
tree | 4478debb455a5026c5974df7e91148194c345679 | |
parent | fb5247a726d60e130d093a9a3865c58fb16e118c (diff) | |
parent | 5878d66ebfe6a25c6d5e495c4fd07e7d3ad634ab (diff) | |
download | forums-adc75b700f0cf3d6d47689c00932fd1f41bc58e9.tar forums-adc75b700f0cf3d6d47689c00932fd1f41bc58e9.tar.gz forums-adc75b700f0cf3d6d47689c00932fd1f41bc58e9.tar.bz2 forums-adc75b700f0cf3d6d47689c00932fd1f41bc58e9.tar.xz forums-adc75b700f0cf3d6d47689c00932fd1f41bc58e9.zip |
Merge pull request #5083 from JoshyPHP/ticket/15512
[ticket/15512] Avoid reparsing non-existent polls
-rw-r--r-- | phpBB/phpbb/textreparser/plugins/poll_title.php | 2 | ||||
-rw-r--r-- | tests/text_reparser/plugins/fixtures/polls.xml | 11 |
2 files changed, 12 insertions, 1 deletions
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 @@ <column>topic_id</column> <column>topic_first_post_id</column> <column>poll_title</column> + <column>poll_start</column> <row> <value>1</value> <value>1</value> <value>This row should be [b]ignored[/b]</value> + <value>1</value> </row> <row> <value>2</value> <value>1</value> <value>[b]Not bold[/b] :) http://example.org</value> + <value>1</value> </row> <row> <value>3</value> <value>2</value> <value>[b:abcd1234]Bold[/b:abcd1234] :) http://example.org</value> + <value>1</value> </row> <row> <value>4</value> <value>3</value> <value><![CDATA[[b]Not bold[/b] <!-- s:) --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!-- s:) --> http://example.org]]></value> + <value>1</value> </row> <row> <value>5</value> <value>4</value> <value><![CDATA[[b]Not bold[/b] :) <!-- m --><a class="postlink" href="http://example.org">http://example.org</a><!-- m -->]]></value> + <value>1</value> </row> <row> <value>6</value> <value>2</value> <value><![CDATA[[flash=123,345:abcd1234]http://example.org/flash.swf[/flash:abcd1234]]]></value> + <value>1</value> </row> <row> <value>7</value> <value>1</value> <value><![CDATA[[flash=123,345]http://example.org/flash.swf[/flash]]]></value> + <value>1</value> </row> <row> <value>8</value> <value>2</value> <value><![CDATA[[img:abcd1234]http://example.org/img.png[/img:abcd1234]]]></value> + <value>1</value> </row> <row> <value>9</value> <value>1</value> <value><![CDATA[[img]http://example.org/img.png[/img]]]></value> + <value>1</value> </row> <row> <value>1000</value> <value>1</value> <value>This row should be [b]ignored[/b]</value> + <value>1</value> </row> </table> </dataset> |