Skip to content

Commit

Permalink
Fixes #1760 Invalid poll showing invalid forum
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-MyBB committed Aug 16, 2012
1 parent ad2a3fd commit 912eff8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions polls.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@

$query = $db->simple_select("polls", "*", "pid='$pid'");
$poll = $db->fetch_array($query);

if(!$poll['pid'])
{
error($lang->error_invalidpoll);
}

$query = $db->simple_select("threads", "*", "poll='$pid'");
$thread = $db->fetch_array($query);
Expand Down Expand Up @@ -471,6 +476,11 @@

$query = $db->simple_select("polls", "*", "pid='".intval($mybb->input['pid'])."'");
$poll = $db->fetch_array($query);

if(!$poll['pid'])
{
error($lang->error_invalidpoll);
}

$query = $db->simple_select("threads", "*", "poll='".intval($mybb->input['pid'])."'");
$thread = $db->fetch_array($query);
Expand Down Expand Up @@ -620,6 +630,12 @@
{
$query = $db->simple_select("polls", "*", "pid='".intval($mybb->input['pid'])."'");
$poll = $db->fetch_array($query);

if(!$poll['pid'])
{
error($lang->error_invalidpoll);
}

$tid = $poll['tid'];
$query = $db->simple_select("threads", "*", "tid='$tid'");
$thread = $db->fetch_array($query);
Expand Down

0 comments on commit 912eff8

Please sign in to comment.