Vergleich xmlhttp.php - 1.8.12 - 1.8.19

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 222Zeile 222
if($mybb->input['action'] == "get_users")
{
$mybb->input['query'] = ltrim($mybb->get_input('query'));

if($mybb->input['action'] == "get_users")
{
$mybb->input['query'] = ltrim($mybb->get_input('query'));

 
	$search_type = $mybb->get_input('search_type', MyBB::INPUT_INT); // 0: contains, 1: starts with, 2: ends with


// If the string is less than 2 characters, quit.
if(my_strlen($mybb->input['query']) < 2)


// If the string is less than 2 characters, quit.
if(my_strlen($mybb->input['query']) < 2)

Zeile 251Zeile 252

$plugins->run_hooks("xmlhttp_get_users_start");



$plugins->run_hooks("xmlhttp_get_users_start");


	$query = $db->simple_select("users", "uid, username", "username LIKE '".$db->escape_string_like($mybb->input['query'])."%'", $query_options);
if($limit == 1)















	$likestring = $db->escape_string_like($mybb->input['query']);
if($search_type == 1)
{
$likestring .= '%';
}
elseif($search_type == 2)
{
$likestring = '%'.$likestring;
}
else
{
$likestring = '%'.$likestring.'%';
}

$query = $db->simple_select("users", "uid, username", "username LIKE '{$likestring}'", $query_options);
if($limit == 1)

	{
$user = $db->fetch_array($query);

	{
$user = $db->fetch_array($query);

		$data = array('id' => $user['username'], 'text' => $user['username']);

		$data = array('uid' => $user['uid'], 'id' => $user['username'], 'text' => $user['username']);

	}
else
{
$data = array();
while($user = $db->fetch_array($query))

	}
else
{
$data = array();
while($user = $db->fetch_array($query))

		{
$data[] = array('id' => $user['username'], 'text' => $user['username']);
}
}


		{
$data[] = array('uid' => $user['uid'], 'id' => $user['username'], 'text' => $user['username']);
}
}


	$plugins->run_hooks("xmlhttp_get_users_end");

echo json_encode($data);

	$plugins->run_hooks("xmlhttp_get_users_end");

echo json_encode($data);

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

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

		}

		}


// Fetch some of the information from the first post of this thread.
$query_options = array(


// Fetch some of the information from the first post of this thread.
$query_options = array(

Zeile 346Zeile 361
	if(my_strtolower($charset) != "utf-8")
{
if(function_exists("iconv"))

	if(my_strtolower($charset) != "utf-8")
{
if(function_exists("iconv"))

		{

		{

			$subject = iconv($charset, "UTF-8//IGNORE", $subject);
}
else if(function_exists("mb_convert_encoding"))

			$subject = iconv($charset, "UTF-8//IGNORE", $subject);
}
else if(function_exists("mb_convert_encoding"))

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

// No result, die.

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

// No result, die.

	if(!$post)

	if(!$post || $post['visible'] == -1)

	{
xmlhttp_error($lang->post_doesnt_exist);
}

	{
xmlhttp_error($lang->post_doesnt_exist);
}

Zeile 532Zeile 547
		if($post['pid'] == $thread['firstpost'])
{
$updatepost['prefix'] = $thread['prefix'];

		if($post['pid'] == $thread['firstpost'])
{
$updatepost['prefix'] = $thread['prefix'];

		}

		}


$posthandler->set_data($updatepost);



$posthandler->set_data($updatepost);


Zeile 544Zeile 559
		}
// No errors were found, we can call the update method.
else

		}
// No errors were found, we can call the update method.
else

		{

		{

			$postinfo = $posthandler->update_post();
$visible = $postinfo['visible'];
if($visible == 0 && !is_moderator($post['fid'], "canviewunapprove"))

			$postinfo = $posthandler->update_post();
$visible = $postinfo['visible'];
if($visible == 0 && !is_moderator($post['fid'], "canviewunapprove"))

Zeile 624Zeile 639
				$post['editreason'] = $parser->parse_badwords($post['editreason']);
$post['editreason'] = htmlspecialchars_uni($post['editreason']);
eval("\$editreason = \"".$templates->get("postbit_editedby_editreason")."\";");

				$post['editreason'] = $parser->parse_badwords($post['editreason']);
$post['editreason'] = htmlspecialchars_uni($post['editreason']);
eval("\$editreason = \"".$templates->get("postbit_editedby_editreason")."\";");

			}

			}

			eval("\$editedmsg = \"".$templates->get("postbit_editedby")."\";");
}


			eval("\$editedmsg = \"".$templates->get("postbit_editedby")."\";");
}


Zeile 805Zeile 820
	$sid = $db->escape_string($mybb->get_input('question_id'));
$query = $db->query("
SELECT q.qid, s.sid

	$sid = $db->escape_string($mybb->get_input('question_id'));
$query = $db->query("
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)
{
xmlhttp_error($lang->answer_valid_not_exists);

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

Zeile 971Zeile 986
		exit;
}
}

		exit;
}
}

else if($mybb->input['action'] == "username_exists")

else if($mybb->input['action'] == "email_availability")

{
if(!verify_post_check($mybb->get_input('my_post_key'), true))
{
xmlhttp_error($lang->invalid_post_code);
}


{
if(!verify_post_check($mybb->get_input('my_post_key'), true))
{
xmlhttp_error($lang->invalid_post_code);
}


	require_once MYBB_ROOT."inc/functions_user.php";
$username = $mybb->get_input('value');



	require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("insert");

$email = $mybb->get_input('email');


header("Content-type: application/json; charset={$charset}");



header("Content-type: application/json; charset={$charset}");


	if(!trim($username))
{
echo json_encode(array("success" => 1));
exit;
}

// Check if the username actually exists
$user = get_user_by_username($username);







	$user = array(
'email' => $email
);

$userhandler->set_data($user);

$errors = array();

if(!$userhandler->verify_email())
{
$errors = $userhandler->get_friendly_errors();
}

$plugins->run_hooks("xmlhttp_email_availability");





	$plugins->run_hooks("xmlhttp_username_exists");

if($user['uid'])
{
$lang->valid_username = $lang->sprintf($lang->valid_username, htmlspecialchars_uni($username));
echo json_encode(array("success" => $lang->valid_username));

	if(!empty($errors))
{
echo json_encode($errors[0]);




		exit;
}
else
{

		exit;
}
else
{

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

		echo json_encode("true");


		exit;
}
}

		exit;
}
}