Vergleich xmlhttp.php - 1.8.13 - 1.8.22

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

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

Zeile 418Zeile 418

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


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





	$plugins->run_hooks("xmlhttp_edit_subject_end");

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

	$plugins->run_hooks("xmlhttp_edit_subject_end");

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

Zeile 436Zeile 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 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 764Zeile 768
	exit;
}
else if($mybb->input['action'] == "refresh_captcha")

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

{
$imagehash = $db->escape_string($mybb->get_input('imagehash'));

{
$imagehash = $db->escape_string($mybb->get_input('imagehash'));

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

	$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;

}

/**

}

/**