1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge remote-tracking branch 'github-nickvergessen/ticket/9776' into develop-olympus

* github-nickvergessen/ticket/9776:
  [ticket/9776] Delete poll if no poll options were submitted.
This commit is contained in:
Nils Adermann
2011-11-18 20:31:26 +01:00
2 changed files with 21 additions and 4 deletions

View File

@@ -1870,9 +1870,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
case 'edit_topic':
case 'edit_first_post':
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
if (isset($poll['poll_options']))
{
$poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time;
$poll_start = ($poll['poll_start'] || empty($poll['poll_options'])) ? $poll['poll_start'] : $current_time;
$poll_length = $poll['poll_length'] * 86400;
if ($poll_length < 0)
{
@@ -2075,11 +2075,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
// Update Poll Tables
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
if (isset($poll['poll_options']))
{
$cur_poll_options = array();
if ($poll['poll_start'] && $mode == 'edit')
if ($mode == 'edit')
{
$sql = 'SELECT *
FROM ' . POLL_OPTIONS_TABLE . '