Vergleich xmlhttp.php - 1.8.20 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 89Zeile 89
	$query = $db->simple_select('themes', 'name, tid, properties, allowedgroups', $loadstyle, array('limit' => 1));
$theme = $db->fetch_array($query);


	$query = $db->simple_select('themes', 'name, tid, properties, allowedgroups', $loadstyle, array('limit' => 1));
$theme = $db->fetch_array($query);


	if(isset($theme['tid']) && !is_member($theme['allowedgroups']) && $theme['allowedgroups'] != 'all')

	if($theme && !is_member($theme['allowedgroups']) && $theme['allowedgroups'] != 'all')

	{
if(isset($mybb->cookies['mybbtheme']))
{

	{
if(isset($mybb->cookies['mybbtheme']))
{

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

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


// 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 254Zeile 254

$likestring = $db->escape_string_like($mybb->input['query']);
if($search_type == 1)


$likestring = $db->escape_string_like($mybb->input['query']);
if($search_type == 1)

	{
$likestring .= '%';
}
elseif($search_type == 2)

 
	{
$likestring = '%'.$likestring;

	{
$likestring = '%'.$likestring;

 
	}
elseif($search_type == 2)
{
$likestring = '%'.$likestring.'%';

	}
else
{

	}
else
{

		$likestring = '%'.$likestring.'%';

		$likestring .= '%';

	}

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

	}

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

Zeile 278Zeile 278
		while($user = $db->fetch_array($query))
{
$data[] = array('uid' => $user['uid'], 'id' => $user['username'], 'text' => $user['username']);

		while($user = $db->fetch_array($query))
{
$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 293Zeile 293
	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);

	}

	}


// We're editing a thread subject.
if($mybb->get_input('tid', MyBB::INPUT_INT))


// We're editing a thread subject.
if($mybb->get_input('tid', MyBB::INPUT_INT))

Zeile 307Zeile 307

// 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(

			"order_by" => "dateline",
"order_dir" => "asc",

			"order_by" => "dateline, pid",


		);
$query = $db->simple_select("posts", "pid,uid,dateline", "tid='".$thread['tid']."'", $query_options);
$post = $db->fetch_array($query);

		);
$query = $db->simple_select("posts", "pid,uid,dateline", "tid='".$thread['tid']."'", $query_options);
$post = $db->fetch_array($query);

Zeile 334Zeile 333

// If this user is not a moderator with "caneditposts" permissions.
if(!is_moderator($forum['fid'], "caneditposts"))


// If this user is not a moderator with "caneditposts" permissions.
if(!is_moderator($forum['fid'], "caneditposts"))

	{

	{

		// Thread is closed - no editing allowed.
if($thread['closed'] == 1)

		// Thread is closed - no editing allowed.
if($thread['closed'] == 1)

		{

		{

			xmlhttp_error($lang->thread_closed_edit_subjects);
}
// Forum is not open, user doesn't have permission to edit, or author doesn't match this user - don't allow editing.
else if($forum['open'] == 0 || $forumpermissions['caneditposts'] == 0 || $mybb->user['uid'] != $post['uid'] || $mybb->user['uid'] == 0)

			xmlhttp_error($lang->thread_closed_edit_subjects);
}
// Forum is not open, user doesn't have permission to edit, or author doesn't match this user - don't allow editing.
else if($forum['open'] == 0 || $forumpermissions['caneditposts'] == 0 || $mybb->user['uid'] != $post['uid'] || $mybb->user['uid'] == 0)

		{

		{

			xmlhttp_error($lang->no_permission_edit_subject);
}
// If we're past the edit time limit - don't allow editing.
else if($mybb->usergroup['edittimelimit'] != 0 && $post['dateline'] < (TIME_NOW-($mybb->usergroup['edittimelimit']*60)))

			xmlhttp_error($lang->no_permission_edit_subject);
}
// If we're past the edit time limit - don't allow editing.
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->usergroup['edittimelimit']);
xmlhttp_error($lang->edit_time_limit);
}
$ismod = false;

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

	}

	}

	else

	else

	{

	{

		$ismod = true;
}
$subject = $mybb->get_input('value');
if(my_strtolower($charset) != "utf-8")
{
if(function_exists("iconv"))

		$ismod = true;
}
$subject = $mybb->get_input('value');
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 386Zeile 385
		$updatepost = array(
"pid" => $post['pid'],
"tid" => $thread['tid'],

		$updatepost = array(
"pid" => $post['pid'],
"tid" => $thread['tid'],

 
			"fid" => $forum['fid'],

			"prefix" => $thread['prefix'],
"subject" => $subject,
"edit_uid" => $mybb->user['uid']

			"prefix" => $thread['prefix'],
"subject" => $subject,
"edit_uid" => $mybb->user['uid']

Zeile 439Zeile 439
	if(!$post || $post['visible'] == -1)
{
xmlhttp_error($lang->post_doesnt_exist);

	if(!$post || $post['visible'] == -1)
{
xmlhttp_error($lang->post_doesnt_exist);

	}


	}


	// Fetch the thread associated with this post.
$thread = get_thread($post['tid']);


	// Fetch the thread associated with this post.
$thread = get_thread($post['tid']);


Zeile 466Zeile 466

// If this user is not a moderator with "caneditposts" permissions.
if(!is_moderator($forum['fid'], "caneditposts"))


// If this user is not a moderator with "caneditposts" permissions.
if(!is_moderator($forum['fid'], "caneditposts"))

	{

	{

		// Thread is closed - no editing allowed.
if($thread['closed'] == 1)
{

		// Thread is closed - no editing allowed.
if($thread['closed'] == 1)
{

Zeile 598Zeile 598
			$parser_options['allow_smilies'] = 0;
}


			$parser_options['allow_smilies'] = 0;
}


		if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)

		if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)

		{
$parser_options['allow_imgcode'] = 0;
}


		{
$parser_options['allow_imgcode'] = 0;
}


		if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)

		if($mybb->user['uid'] != 0 && $mybb->user['showvideos'] != 1 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)

		{
$parser_options['allow_videocode'] = 0;
}

		{
$parser_options['allow_videocode'] = 0;
}

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

$editedmsg_response = null;

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

$editedmsg_response = null;

		if($editedmsg)

		if(!empty($editedmsg))

		{
$editedmsg_response = str_replace(array("\r", "\n"), "", $editedmsg);
}

		{
$editedmsg_response = str_replace(array("\r", "\n"), "", $editedmsg);
}

Zeile 735Zeile 735
		LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE {$from_tid}p.pid IN ({$quoted_posts}) {$unviewable_forums} {$inactiveforums}

		LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE {$from_tid}p.pid IN ({$quoted_posts}) {$unviewable_forums} {$inactiveforums}

		ORDER BY p.dateline

		ORDER BY p.dateline, p.pid

	");
while($quoted_post = $db->fetch_array($query))
{

	");
while($quoted_post = $db->fetch_array($query))
{

Zeile 782Zeile 782
		"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW

		"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW

	);

$plugins->run_hooks("xmlhttp_refresh_captcha");

	);

$plugins->run_hooks("xmlhttp_refresh_captcha");


$db->insert_query("captcha", $regimagearray);
header("Content-type: application/json; charset={$charset}");


$db->insert_query("captcha", $regimagearray);
header("Content-type: application/json; charset={$charset}");

Zeile 809Zeile 809
	{
//echo json_encode(array("success" => $lang->captcha_matches));
echo json_encode("true");

	{
//echo json_encode(array("success" => $lang->captcha_matches));
echo json_encode("true");

		exit;
}
else

		exit;
}
else

	{
echo json_encode($lang->captcha_does_not_match);
exit;

	{
echo json_encode($lang->captcha_does_not_match);
exit;

Zeile 824Zeile 824
	$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

		FROM ".TABLE_PREFIX."questionsessions s

		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}'
");

Zeile 847Zeile 847
		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']}'

		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");

















	");

$plugins->run_hooks("xmlhttp_refresh_question");

require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

$parser_options = array(
"allow_html" => 0,
"allow_mycode" => 1,
"allow_smilies" => 1,
"allow_imgcode" => 1,
"allow_videocode" => 1,
"filter_badwords" => 1,
"me_username" => 0,
"shorten_urls" => 0,
"highlight" => 0,
);


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


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


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

		echo json_encode(array("question" => $parser->parse_message($question['question'], $parser_options), 'sid' => htmlspecialchars_uni($question['sid'])));

		exit;
}
else

		exit;
}
else

Zeile 877Zeile 892
	");

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

	");

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

	{

	{

		echo json_encode($lang->answer_valid_not_exists);
exit;
}

		echo json_encode($lang->answer_valid_not_exists);
exit;
}

Zeile 890Zeile 905
		foreach($valid_answers as $answers)
{
if(my_strtolower($answers) == my_strtolower($answer))

		foreach($valid_answers as $answers)
{
if(my_strtolower($answers) == my_strtolower($answer))

			{

			{

				$validated = 1;
}
}

				$validated = 1;
}
}

Zeile 915Zeile 930
{
$password = trim($mybb->get_input('password'));
$password = str_replace(array(unichr(160), unichr(173), unichr(0xCA), dec_to_utf8(8238), dec_to_utf8(8237), dec_to_utf8(8203)), array(" ", "-", "", "", "", ""), $password);

{
$password = trim($mybb->get_input('password'));
$password = str_replace(array(unichr(160), unichr(173), unichr(0xCA), dec_to_utf8(8238), dec_to_utf8(8237), dec_to_utf8(8203)), array(" ", "-", "", "", "", ""), $password);





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

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





	$plugins->run_hooks("xmlhttp_complex_password");

if(!preg_match("/^.*(?=.{".$mybb->settings['minpasswordlength'].",})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/", $password))
{
echo json_encode($lang->complex_password_fails);

	$plugins->run_hooks("xmlhttp_complex_password");

if(!preg_match("/^.*(?=.{".$mybb->settings['minpasswordlength'].",})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/", $password))
{
echo json_encode($lang->complex_password_fails);

	}

	}

	else
{
// Return nothing but an OK password if passes regex

	else
{
// Return nothing but an OK password if passes regex

		echo json_encode("true");
}

		echo json_encode("true");
}


exit;
}


exit;
}

Zeile 938Zeile 953
	{
xmlhttp_error($lang->invalid_post_code);
}

	{
xmlhttp_error($lang->invalid_post_code);
}





	require_once MYBB_ROOT."inc/functions_user.php";

	require_once MYBB_ROOT."inc/functions_user.php";

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


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


	// Fix bad characters
$username = trim_blank_chrs($username);
$username = str_replace(array(unichr(160), unichr(173), unichr(0xCA), dec_to_utf8(8238), dec_to_utf8(8237), dec_to_utf8(8203)), array(" ", "-", "", "", "", ""), $username);

	// Fix bad characters
$username = trim_blank_chrs($username);
$username = str_replace(array(unichr(160), unichr(173), unichr(0xCA), dec_to_utf8(8238), dec_to_utf8(8237), dec_to_utf8(8203)), array(" ", "-", "", "", "", ""), $username);





	// Remove multiple spaces from the username
$username = preg_replace("#\s{2,}#", " ", $username);

	// Remove multiple spaces from the username
$username = preg_replace("#\s{2,}#", " ", $username);





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

if(empty($username))

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

if(empty($username))

	{
echo json_encode($lang->banned_characters_username);
exit;
}


	{
echo json_encode($lang->banned_characters_username);
exit;
}


	// Check if the username belongs to the list of banned usernames.
$banned_username = is_banned_username($username, true);
if($banned_username)

	// Check if the username belongs to the list of banned usernames.
$banned_username = is_banned_username($username, true);
if($banned_username)

Zeile 967Zeile 982

// 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 || strpos($username, ",") !== false || !validate_utf8_string($username, false, false))


// 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 || strpos($username, ",") !== false || !validate_utf8_string($username, false, false))

	{

	{

		echo json_encode($lang->banned_characters_username);
exit;
}

		echo json_encode($lang->banned_characters_username);
exit;
}





	// Check if the username is actually already in use
$user = get_user_by_username($username);

$plugins->run_hooks("xmlhttp_username_availability");


	// Check if the username is actually already in use
$user = get_user_by_username($username);

$plugins->run_hooks("xmlhttp_username_availability");


	if($user['uid'])

	if($user)

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

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

		exit;

		exit;

	}
else
{
//$lang->username_available = $lang->sprintf($lang->username_available, htmlspecialchars_uni($username));
echo json_encode("true");
exit;

	}
else
{
//$lang->username_available = $lang->sprintf($lang->username_available, htmlspecialchars_uni($username));
echo json_encode("true");
exit;

	}

	}

}
else if($mybb->input['action'] == "email_availability")
{
if(!verify_post_check($mybb->get_input('my_post_key'), true))
{
xmlhttp_error($lang->invalid_post_code);

}
else if($mybb->input['action'] == "email_availability")
{
if(!verify_post_check($mybb->get_input('my_post_key'), true))
{
xmlhttp_error($lang->invalid_post_code);

	}


	}


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

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


	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}");


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

$userhandler->set_data($user);


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

$userhandler->set_data($user);


	$errors = array();


	$errors = array();


	if(!$userhandler->verify_email())

	if(!$userhandler->verify_email())

	{

	{

		$errors = $userhandler->get_friendly_errors();
}

		$errors = $userhandler->get_friendly_errors();
}





	$plugins->run_hooks("xmlhttp_email_availability");

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

	$plugins->run_hooks("xmlhttp_email_availability");

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

		exit;

		exit;

	}
else
{

	}
else
{

Zeile 1091Zeile 1106
	} else {
foreach($referrals as $referral)
{

	} else {
foreach($referrals as $referral)
{

 
			$bg_color = alt_trow();

			// Format user name link
$username = htmlspecialchars_uni($referral['username']);
$username = format_name($username, $referral['usergroup'], $referral['displaygroup']);
$username = build_profile_link($username, $referral['uid']);

			// Format user name link
$username = htmlspecialchars_uni($referral['username']);
$username = format_name($username, $referral['usergroup'], $referral['displaygroup']);
$username = build_profile_link($username, $referral['uid']);





			$regdate = my_date('normal', $referral['regdate']);

			$regdate = my_date('normal', $referral['regdate']);





			eval("\$referral_rows .= \"".$templates->get('member_referral_row')."\";");

			eval("\$referral_rows .= \"".$templates->get('member_referral_row')."\";");


$bg_color = alt_trow();

 
		}
}


		}
}