Vergleich xmlhttp.php - 1.8.3 - 1.8.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 28Zeile 28
// Load MyBB core files
require_once dirname(__FILE__)."/inc/init.php";


// Load MyBB core files
require_once dirname(__FILE__)."/inc/init.php";


$shutdown_queries = array();

$shutdown_queries = $shutdown_functions = array();


// Load some of the stock caches we'll be using.
$groupscache = $cache->read("usergroups");


// Load some of the stock caches we'll be using.
$groupscache = $cache->read("usergroups");

Zeile 201Zeile 201
		exit;
}


		exit;
}


	if($mybb->get_input('getone', 1) == 1)

	if($mybb->get_input('getone', MyBB::INPUT_INT) == 1)

	{
$limit = 1;
}

	{
$limit = 1;
}

Zeile 255Zeile 255
	}

// We're editing a thread subject.

	}

// We're editing a thread subject.

	if($mybb->get_input('tid', 1))

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

	{
// Fetch the thread.

	{
// Fetch the thread.

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

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

		if(!$thread)
{
xmlhttp_error($lang->thread_doesnt_exist);

		if(!$thread)
{
xmlhttp_error($lang->thread_doesnt_exist);

Zeile 387Zeile 387
else if($mybb->input['action'] == "edit_post")
{
// Fetch the post from the database.

else if($mybb->input['action'] == "edit_post")
{
// Fetch the post from the database.

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

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


// No result, die.
if(!$post)


// No result, die.
if(!$post)

Zeile 426Zeile 426
			xmlhttp_error($lang->no_permission_edit_post);
}
// If we're past the edit time limit - don't allow editing.

			xmlhttp_error($lang->no_permission_edit_post);
}
// If we're past the edit time limit - don't allow editing.

		else if($mybb->settings['edittimelimit'] != 0 && $post['dateline'] < (TIME_NOW-($mybb->settings['edittimelimit']*60)))

		else if($mybb->usergroup['edittimelimit'] != 0 && $post['dateline'] < (TIME_NOW-($mybb->usergroup['edittimelimit']*60)))

		{

		{

			$lang->edit_time_limit = $lang->sprintf($lang->edit_time_limit, $mybb->settings['edittimelimit']);

			$lang->edit_time_limit = $lang->sprintf($lang->edit_time_limit, $mybb->usergroup['edittimelimit']);

			xmlhttp_error($lang->edit_time_limit);
}
// User can't edit unapproved post

			xmlhttp_error($lang->edit_time_limit);
}
// User can't edit unapproved post

Zeile 518Zeile 518
				if($thread['firstpost'] == $post['pid'])
{
echo json_encode(array("moderation_thread" => $lang->thread_moderation, 'url' => $mybb->settings['bburl'].'/'.get_forum_link($thread['fid']), "message" => $post['message']));

				if($thread['firstpost'] == $post['pid'])
{
echo json_encode(array("moderation_thread" => $lang->thread_moderation, 'url' => $mybb->settings['bburl'].'/'.get_forum_link($thread['fid']), "message" => $post['message']));

					exit;

					exit;

				}
else
{

				}
else
{

Zeile 649Zeile 649
	// Are we loading all quoted posts or only those not in the current thread?
if(empty($mybb->input['load_all']))
{

	// Are we loading all quoted posts or only those not in the current thread?
if(empty($mybb->input['load_all']))
{

		$from_tid = "p.tid != '".$mybb->get_input('tid', 1)."' AND ";

		$from_tid = "p.tid != '".$mybb->get_input('tid', MyBB::INPUT_INT)."' AND ";

	}
else
{

	}
else
{

Zeile 701Zeile 701
	if($db->num_rows($query) == 0)
{
xmlhttp_error($lang->captcha_not_exists);

	if($db->num_rows($query) == 0)
{
xmlhttp_error($lang->captcha_not_exists);

	}

	}

	$db->delete_query("captcha", "imagehash='$imagehash'");
$randomstr = random_str(5);
$imagehash = md5(random_str(12));

	$db->delete_query("captcha", "imagehash='$imagehash'");
$randomstr = random_str(5);
$imagehash = md5(random_str(12));

Zeile 725Zeile 725
	$query = $db->simple_select("captcha", "imagestring", "imagehash='$imagehash'");
if($db->num_rows($query) == 0)
{

	$query = $db->simple_select("captcha", "imagestring", "imagehash='$imagehash'");
if($db->num_rows($query) == 0)
{

		echo $lang->captcha_valid_not_exists;

		echo json_encode($lang->captcha_valid_not_exists);

		exit;
}
$imagestring = $db->fetch_field($query, 'imagestring');

		exit;
}
$imagestring = $db->fetch_field($query, 'imagestring');

Zeile 750Zeile 750
	
$sid = $db->escape_string($mybb->get_input('question_id'));
$query = $db->query("

	
$sid = $db->escape_string($mybb->get_input('question_id'));
$query = $db->query("

		SELECT q.*, s.sid

		SELECT q.qid, s.sid

		FROM ".TABLE_PREFIX."questionsessions s
LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}'
");

		FROM ".TABLE_PREFIX."questionsessions s
LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}'
");

 
	

	if($db->num_rows($query) == 0)

	if($db->num_rows($query) == 0)

	{
xmlhttp_error($lang->answer_valid_not_exists);
}

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

	{
xmlhttp_error($lang->answer_valid_not_exists);
}

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

	
// Delete previous question session
$db->delete_query("questionsessions", "sid='$sid'");

	
// Delete previous question session
$db->delete_query("questionsessions", "sid='$sid'");

	
require_once MYBB_ROOT."inc/functions_user.php";

$sid = generate_question();

	
require_once MYBB_ROOT."inc/functions_user.php";

$sid = generate_question($qsession['qid']);

	$query = $db->query("
SELECT q.question, s.sid
FROM ".TABLE_PREFIX."questionsessions s
LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}' AND q.qid!='{$qsession['qid']}'
");

	$query = $db->query("
SELECT q.question, s.sid
FROM ".TABLE_PREFIX."questionsessions s
LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}' AND q.qid!='{$qsession['qid']}'
");

 
	
$plugins->run_hooks("xmlhttp_refresh_question");


	if($db->num_rows($query) > 0)

	if($db->num_rows($query) > 0)

	{

	{

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

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

 
		
echo json_encode(array("question" => htmlspecialchars_uni($question['question']), 'sid' => htmlspecialchars_uni($question['sid'])));
exit;
}
else
{
xmlhttp_error($lang->answer_valid_not_exists);

	}

	}

	
$plugins->run_hooks("xmlhttp_refresh_question");

echo json_encode(array("question" => htmlspecialchars_uni($question['question']), 'sid' => htmlspecialchars_uni($question['sid'])));
exit;

 
}
elseif($mybb->input['action'] == "validate_question" && $mybb->settings['securityquestion'])
{

}
elseif($mybb->input['action'] == "validate_question" && $mybb->settings['securityquestion'])
{

Zeile 796Zeile 802
		LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}'
");

		LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}'
");

 
	

	if($db->num_rows($query) == 0)
{

	if($db->num_rows($query) == 0)
{

		echo $lang->answer_valid_not_exists;

		echo json_encode($lang->answer_valid_not_exists);

		exit;
}
else

		exit;
}
else

Zeile 873Zeile 880

if(empty($username))
{


if(empty($username))
{

		echo $lang->banned_characters_username;

		echo json_encode($lang->banned_characters_username);

		exit;
}


		exit;
}


Zeile 881Zeile 888
	$banned_username = is_banned_username($username, true);
if($banned_username)
{

	$banned_username = is_banned_username($username, true);
if($banned_username)
{

		echo $lang->banned_username;

		echo json_encode($lang->banned_username);

		exit;
}

// Check for certain characters in username (<, >, &, and slashes)
if(strpos($username, "<") !== false || strpos($username, ">") !== false || strpos($username, "&") !== false || my_strpos($username, "\\") !== false || strpos($username, ";") !== false || !validate_utf8_string($username, false, false))
{

		exit;
}

// Check for certain characters in username (<, >, &, and slashes)
if(strpos($username, "<") !== false || strpos($username, ">") !== false || strpos($username, "&") !== false || my_strpos($username, "\\") !== false || strpos($username, ";") !== false || !validate_utf8_string($username, false, false))
{

		echo $lang->banned_characters_username;

		echo json_encode($lang->banned_characters_username);

		exit;
}


		exit;
}


Zeile 941Zeile 948
	}
else
{

	}
else
{

		$lang->invalid_username = htmlspecialchars_uni($lang->sprintf($lang->invalid_username, htmlspecialchars_uni($username)));
echo $lang->invalid_username;

		$lang->invalid_username = $lang->sprintf($lang->invalid_username, htmlspecialchars_uni($username));
echo json_encode($lang->invalid_username);

		exit;
}
}

		exit;
}
}