Vergleich xmlhttp.php - 1.8.18 - 1.8.25

  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

	$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 356Zeile 356
	else
{
$ismod = true;

	else
{
$ismod = true;

	}

	}

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

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

		{

		{

			$subject = iconv($charset, "UTF-8//IGNORE", $subject);

			$subject = iconv($charset, "UTF-8//IGNORE", $subject);

		}

		}

		else if(function_exists("mb_convert_encoding"))
{
$subject = @mb_convert_encoding($subject, $charset, "UTF-8");
}
else if(my_strtolower($charset) == "iso-8859-1")

		else if(function_exists("mb_convert_encoding"))
{
$subject = @mb_convert_encoding($subject, $charset, "UTF-8");
}
else if(my_strtolower($charset) == "iso-8859-1")

		{

		{

			$subject = utf8_decode($subject);
}
}

			$subject = utf8_decode($subject);
}
}

Zeile 394Zeile 394

// Now let the post handler do all the hard work.
if(!$posthandler->validate_post())


// Now let the post handler do all the hard work.
if(!$posthandler->validate_post())

		{

		{

			$post_errors = $posthandler->get_friendly_errors();
xmlhttp_error($post_errors);
}

			$post_errors = $posthandler->get_friendly_errors();
xmlhttp_error($post_errors);
}

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

$plugins->run_hooks("xmlhttp_edit_subject_end");

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

$plugins->run_hooks("xmlhttp_edit_subject_end");





	$mybb->input['value'] = $parser->parse_badwords($mybb->get_input('value'));

// Spit the subject back to the browser.

	$mybb->input['value'] = $parser->parse_badwords($mybb->get_input('value'));

// Spit the subject back to the browser.

Zeile 457Zeile 457
	if(check_forum_password($forum['fid'], 0, true))
{
xmlhttp_error($lang->wrong_forum_password);

	if(check_forum_password($forum['fid'], 0, true))
{
xmlhttp_error($lang->wrong_forum_password);

	}

	}


// Fetch forum permissions.
$forumpermissions = forum_permissions($forum['fid']);


// Fetch forum permissions.
$forumpermissions = forum_permissions($forum['fid']);

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

			$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
if($post['visible'] == 0)

		// User can't edit unapproved post unless permitted for own
if($post['visible'] == 0 && !($mybb->settings['showownunapproved'] && $post['uid'] == $mybb->user['uid']))

		{
xmlhttp_error($lang->post_moderation);
}

		{
xmlhttp_error($lang->post_moderation);
}

Zeile 745Zeile 745
			(in_array($quoted_post['fid'], $onlyusfids) && (!$mybb->user['uid'] || $quoted_post['thread_uid'] != $mybb->user['uid']))
)
{

			(in_array($quoted_post['fid'], $onlyusfids) && (!$mybb->user['uid'] || $quoted_post['thread_uid'] != $mybb->user['uid']))
)
{

			continue;





			// Allow quoting from own unapproved post
if($quoted_post['visible'] == 0 && !($mybb->settings['showownunapproved'] && $quoted_post['uid'] == $mybb->user['uid']))
{
continue;
}

		}

$message .= parse_quoted_message($quoted_post, false);

		}

$message .= parse_quoted_message($quoted_post, false);

Zeile 757Zeile 761

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


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





	$plugins->run_hooks("xmlhttp_get_multiquoted_end");

echo json_encode(array("message" => $message));
exit;
}
else if($mybb->input['action'] == "refresh_captcha")

	$plugins->run_hooks("xmlhttp_get_multiquoted_end");

echo json_encode(array("message" => $message));
exit;
}
else if($mybb->input['action'] == "refresh_captcha")

{

{

	$imagehash = $db->escape_string($mybb->get_input('imagehash'));
$query = $db->simple_select("captcha", "dateline", "imagehash='$imagehash'");
if($db->num_rows($query) == 0)

	$imagehash = $db->escape_string($mybb->get_input('imagehash'));
$query = $db->simple_select("captcha", "dateline", "imagehash='$imagehash'");
if($db->num_rows($query) == 0)

Zeile 795Zeile 799
	if($db->num_rows($query) == 0)
{
echo json_encode($lang->captcha_valid_not_exists);

	if($db->num_rows($query) == 0)
{
echo json_encode($lang->captcha_valid_not_exists);

		exit;

		exit;

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

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





	$plugins->run_hooks("xmlhttp_validate_captcha");

if(my_strtolower($imagestring) == my_strtolower($mybb->get_input('imagestring')))
{
//echo json_encode(array("success" => $lang->captcha_matches));
echo json_encode("true");

	$plugins->run_hooks("xmlhttp_validate_captcha");

if(my_strtolower($imagestring) == my_strtolower($mybb->get_input('imagestring')))
{
//echo json_encode(array("success" => $lang->captcha_matches));
echo json_encode("true");

		exit;

		exit;

	}
else
{

	}
else
{

Zeile 846Zeile 850
	");

$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 1070Zeile 1089
	{
xmlhttp_error($lang->buddylist_error);
}

	{
xmlhttp_error($lang->buddylist_error);
}

 
}
else if($mybb->input['action'] == 'get_referrals')
{
$lang->load('member');
$uid = $mybb->get_input('uid', MYBB::INPUT_INT);

if (!$uid) {
xmlhttp_error($lang->referrals_no_user_specified);
}

$referrals = get_user_referrals($uid);

if (empty($referrals)) {
eval("\$referral_rows = \"".$templates->get('member_no_referrals')."\";");
} 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']);

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

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

$plugins->run_hooks('xmlhttp_referrals_end');

eval("\$referrals = \"".$templates->get('member_referrals_popup', 1, 0)."\";");

// Send our headers and output.
header("Content-type: text/plain; charset={$charset}");
echo $referrals;

}

/**

}

/**