Vergleich polls.php - 1.8.0 - 1.8.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 46Zeile 46
if($mybb->input['action'] == "newpoll")
{
// Form for new poll

if($mybb->input['action'] == "newpoll")
{
// Form for new poll

	$tid = $mybb->get_input('tid', 1);

	$tid = $mybb->get_input('tid', MyBB::INPUT_INT);


$plugins->run_hooks("polls_newpoll_start");



$plugins->run_hooks("polls_newpoll_start");


	$thread = get_thread($mybb->get_input('tid', 1));

	$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));

	if(!$thread)
{
error($lang->error_invalidthread);

	if(!$thread)
{
error($lang->error_invalidthread);

Zeile 114Zeile 114
	}

// Sanitize number of poll options

	}

// Sanitize number of poll options

	if($mybb->get_input('numpolloptions', 1) > 0)

	if($mybb->get_input('numpolloptions', MyBB::INPUT_INT) > 0)

	{

	{

		$mybb->input['polloptions'] = $mybb->get_input('numpolloptions', 1);

		$mybb->input['polloptions'] = $mybb->get_input('numpolloptions', MyBB::INPUT_INT);

	}

	}

	if($mybb->settings['maxpolloptions'] && $mybb->get_input('polloptions', 1) > $mybb->settings['maxpolloptions'])

	if($mybb->settings['maxpolloptions'] && $mybb->get_input('polloptions', MyBB::INPUT_INT) > $mybb->settings['maxpolloptions'])

	{	// Too big
$polloptions = $mybb->settings['maxpolloptions'];
}

	{	// Too big
$polloptions = $mybb->settings['maxpolloptions'];
}

	elseif($mybb->get_input('polloptions', 1) < 2)

	elseif($mybb->get_input('polloptions', MyBB::INPUT_INT) < 2)

	{	// Too small
$polloptions = 2;
}
else
{ // Just right

	{	// Too small
$polloptions = 2;
}
else
{ // Just right

		$polloptions = $mybb->get_input('polloptions', 1);

		$polloptions = $mybb->get_input('polloptions', MyBB::INPUT_INT);

	}

$question = htmlspecialchars_uni($mybb->get_input('question'));

$postoptionschecked = array('public' => '', 'multiple' => '');

	}

$question = htmlspecialchars_uni($mybb->get_input('question'));

$postoptionschecked = array('public' => '', 'multiple' => '');

	$postoptions = $mybb->get_input('postoptions', 1);

	$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_INT);

	if(isset($postoptions['multiple']) && $postoptions['multiple'] == 1)
{
$postoptionschecked['multiple'] = 'checked="checked"';

	if(isset($postoptions['multiple']) && $postoptions['multiple'] == 1)
{
$postoptionschecked['multiple'] = 'checked="checked"';

Zeile 144Zeile 144
		$postoptionschecked['public'] = 'checked="checked"';
}


		$postoptionschecked['public'] = 'checked="checked"';
}


	$options = $mybb->get_input('options', 2);

	$options = $mybb->get_input('options', MyBB::INPUT_ARRAY);

	$optionbits = '';
for($i = 1; $i <= $polloptions; ++$i)
{

	$optionbits = '';
for($i = 1; $i <= $polloptions; ++$i)
{

Zeile 158Zeile 158
		$option = "";
}


		$option = "";
}


	if($mybb->get_input('timeout', 1) > 0)

	if($mybb->get_input('timeout', MyBB::INPUT_INT) > 0)

	{

	{

		$timeout = $mybb->get_input('timeout', 1);

		$timeout = $mybb->get_input('timeout', MyBB::INPUT_INT);

	}
else
{
$timeout = 0;
}


	}
else
{
$timeout = 0;
}


	if($mybb->get_input('maxoptions', 1) > 0 && $mybb->get_input('maxoptions', 1) < $polloptions)

	if($mybb->get_input('maxoptions', MyBB::INPUT_INT) > 0 && $mybb->get_input('maxoptions', MyBB::INPUT_INT) < $polloptions)

	{

	{

		$maxoptions = $mybb->get_input('maxoptions', 1);

		$maxoptions = $mybb->get_input('maxoptions', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 188Zeile 188

$plugins->run_hooks("polls_do_newpoll_start");



$plugins->run_hooks("polls_do_newpoll_start");


	$thread = get_thread($mybb->get_input('tid', 1));

	$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));

	if(!$thread)
{
error($lang->error_invalidthread);

	if(!$thread)
{
error($lang->error_invalidthread);

Zeile 224Zeile 224
		error($lang->error_pollalready);
}


		error($lang->error_pollalready);
}


	$polloptions = $mybb->get_input('polloptions', 1);

	$polloptions = $mybb->get_input('polloptions', MyBB::INPUT_INT);

	if($mybb->settings['maxpolloptions'] && $polloptions > $mybb->settings['maxpolloptions'])
{
$polloptions = $mybb->settings['maxpolloptions'];
}


	if($mybb->settings['maxpolloptions'] && $polloptions > $mybb->settings['maxpolloptions'])
{
$polloptions = $mybb->settings['maxpolloptions'];
}


	$postoptions = $mybb->get_input('postoptions', 2);

	$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);

	if(!isset($postoptions['multiple']) || $postoptions['multiple'] != '1')
{
$postoptions['multiple'] = 0;

	if(!isset($postoptions['multiple']) || $postoptions['multiple'] != '1')
{
$postoptions['multiple'] = 0;

Zeile 246Zeile 246
		$polloptions = "2";
}
$optioncount = "0";

		$polloptions = "2";
}
$optioncount = "0";

	$options = $mybb->get_input('options', 2);

	$options = $mybb->get_input('options', MyBB::INPUT_ARRAY);


for($i = 1; $i <= $polloptions; ++$i)
{


for($i = 1; $i <= $polloptions; ++$i)
{

Zeile 295Zeile 295
		}
}


		}
}


	if($mybb->get_input('timeout', 1) > 0)

	if($mybb->get_input('timeout', MyBB::INPUT_INT) > 0)

	{

	{

		$timeout = $mybb->get_input('timeout', 1);

		$timeout = $mybb->get_input('timeout', MyBB::INPUT_INT);

	}
else
{
$timeout = 0;
}


	}
else
{
$timeout = 0;
}


	if($mybb->get_input('maxoptions', 1) > 0 && $mybb->get_input('maxoptions', 1) < $polloptions)

	if($mybb->get_input('maxoptions', MyBB::INPUT_INT) > 0 && $mybb->get_input('maxoptions', MyBB::INPUT_INT) < $polloptions)

	{

	{

		$maxoptions = $mybb->get_input('maxoptions', 1);

		$maxoptions = $mybb->get_input('maxoptions', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 348Zeile 348

if($mybb->input['action'] == "editpoll")
{


if($mybb->input['action'] == "editpoll")
{

	$pid = $mybb->get_input('pid', 1);

	$pid = $mybb->get_input('pid', MyBB::INPUT_INT);


$plugins->run_hooks("polls_editpoll_start");



$plugins->run_hooks("polls_editpoll_start");


Zeile 467Zeile 467
	}
else
{

	}
else
{

		if($mybb->settings['maxpolloptions'] && $mybb->get_input('numoptions', 1) > $mybb->settings['maxpolloptions'])

		if($mybb->settings['maxpolloptions'] && $mybb->get_input('numoptions', MyBB::INPUT_INT) > $mybb->settings['maxpolloptions'])

		{
$numoptions = $mybb->settings['maxpolloptions'];
}

		{
$numoptions = $mybb->settings['maxpolloptions'];
}

		elseif($mybb->get_input('numoptions', 1) < 2)

		elseif($mybb->get_input('numoptions', MyBB::INPUT_INT) < 2)

		{
$numoptions = 2;
}
else
{

		{
$numoptions = 2;
}
else
{

			$numoptions = $mybb->get_input('numoptions', 1);

			$numoptions = $mybb->get_input('numoptions', MyBB::INPUT_INT);

		}
$question = htmlspecialchars_uni($mybb->input['question']);


		}
$question = htmlspecialchars_uni($mybb->input['question']);


		$postoptions = $mybb->get_input('postoptions', 2);

		$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);

		if(isset($postoptions['multiple']) && $postoptions['multiple'] == 1)
{
$postoptionschecked['multiple'] = 'checked="checked"';

		if(isset($postoptions['multiple']) && $postoptions['multiple'] == 1)
{
$postoptionschecked['multiple'] = 'checked="checked"';

Zeile 497Zeile 497
			$postoptionschecked['closed'] = 'checked="checked"';
}


			$postoptionschecked['closed'] = 'checked="checked"';
}


		$options = $mybb->get_input('options', 2);
$votes = $mybb->get_input('votes', 2);

		$options = $mybb->get_input('options', MyBB::INPUT_ARRAY);
$votes = $mybb->get_input('votes', MyBB::INPUT_ARRAY);

		$optionbits = '';
for($i = 1; $i <= $numoptions; ++$i)
{

		$optionbits = '';
for($i = 1; $i <= $numoptions; ++$i)
{

Zeile 523Zeile 523
			$option = "";
}


			$option = "";
}


		if($mybb->get_input('timeout', 1) > 0)

		if($mybb->get_input('timeout', MyBB::INPUT_INT) > 0)

		{

		{

			$timeout = $mybb->get_input('timeout', 1);

			$timeout = $mybb->get_input('timeout', MyBB::INPUT_INT);

		}
else
{

		}
else
{

Zeile 555Zeile 555

$plugins->run_hooks("polls_do_editpoll_start");



$plugins->run_hooks("polls_do_editpoll_start");


	$query = $db->simple_select("polls", "*", "pid='".$mybb->get_input('pid', 1)."'");

	$query = $db->simple_select("polls", "*", "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'");

	$poll = $db->fetch_array($query);

if(!$poll)

	$poll = $db->fetch_array($query);

if(!$poll)

Zeile 563Zeile 563
		error($lang->error_invalidpoll);
}


		error($lang->error_invalidpoll);
}


	$query = $db->simple_select("threads", "*", "poll='".$mybb->get_input('pid', 1)."'");

	$query = $db->simple_select("threads", "*", "poll='".$mybb->get_input('pid', MyBB::INPUT_INT)."'");

	$thread = $db->fetch_array($query);
if(!$thread)
{

	$thread = $db->fetch_array($query);
if(!$thread)
{

Zeile 574Zeile 574

// Get forum info
$forum = get_forum($thread['fid']);


// Get forum info
$forum = get_forum($thread['fid']);

 
	$fid = $thread['fid'];

	if(!$forum)
{
error($lang->error_invalidforum);

	if(!$forum)
{
error($lang->error_invalidforum);

Zeile 593Zeile 594
		error_no_permission();
}


		error_no_permission();
}


	if($mybb->settings['maxpolloptions'] && $mybb->get_input('numoptions', 1) > $mybb->settings['maxpolloptions'])

	if($mybb->settings['maxpolloptions'] && $mybb->get_input('numoptions', MyBB::INPUT_INT) > $mybb->settings['maxpolloptions'])

	{
$numoptions = $mybb->settings['maxpolloptions'];
}

	{
$numoptions = $mybb->settings['maxpolloptions'];
}

	elseif($mybb->get_input('numoptions', 1) < 2)

	elseif($mybb->get_input('numoptions', MyBB::INPUT_INT) < 2)

	{
$numoptions = 2;
}
else
{

	{
$numoptions = 2;
}
else
{

		$numoptions = $mybb->get_input('numoptions', 1);

		$numoptions = $mybb->get_input('numoptions', MyBB::INPUT_INT);

	}


	}


	$postoptions = $mybb->get_input('postoptions', 2);

	$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);

	if(!isset($postoptions['multiple']) || $postoptions['multiple'] != '1')
{
$postoptions['multiple'] = 0;

	if(!isset($postoptions['multiple']) || $postoptions['multiple'] != '1')
{
$postoptions['multiple'] = 0;

Zeile 677Zeile 678
		}
}


		}
}


	if($mybb->get_input('timeout', 1) > 0)

	if($mybb->get_input('timeout', MyBB::INPUT_INT) > 0)

	{

	{

		$timeout = $mybb->get_input('timeout', 1);

		$timeout = $mybb->get_input('timeout', MyBB::INPUT_INT);

	}
else
{
$timeout = 0;
}


	}
else
{
$timeout = 0;
}


	if($mybb->get_input('maxoptions', 1) > 0 && $mybb->get_input('maxoptions', 1) < $numoptions)

	if($mybb->get_input('maxoptions', MyBB::INPUT_INT) > 0 && $mybb->get_input('maxoptions', MyBB::INPUT_INT) < $numoptions)

	{

	{

		$maxoptions = $mybb->get_input('maxoptions', 1);

		$maxoptions = $mybb->get_input('maxoptions', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 710Zeile 711

$plugins->run_hooks("polls_do_editpoll_process");



$plugins->run_hooks("polls_do_editpoll_process");


	$db->update_query("polls", $updatedpoll, "pid='".$mybb->get_input('pid', 1)."'");

	$db->update_query("polls", $updatedpoll, "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'");


$plugins->run_hooks("polls_do_editpoll_end");



$plugins->run_hooks("polls_do_editpoll_end");


Zeile 723Zeile 724

if($mybb->input['action'] == "showresults")
{


if($mybb->input['action'] == "showresults")
{

	$query = $db->simple_select("polls", "*", "pid='".$mybb->get_input('pid', 1)."'");

	$query = $db->simple_select("polls", "*", "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'");

	$poll = $db->fetch_array($query);

if(!$poll)

	$poll = $db->fetch_array($query);

if(!$poll)

Zeile 1053Zeile 1054
		error_no_permission();
}


		error_no_permission();
}


	$query = $db->simple_select("polls", "*", "pid='".$mybb->get_input('pid', 1)."'");

	$query = $db->simple_select("polls", "*", "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'");

	$poll = $db->fetch_array($query);

if(!$poll['pid'])

	$poll = $db->fetch_array($query);

if(!$poll['pid'])