Vergleich xmlhttp.php - 1.8.6 - 1.8.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 124Zeile 124

// Set the appropriate image language directory for this theme.
// Are we linking to a remote theme server?


// Set the appropriate image language directory for this theme.
// Are we linking to a remote theme server?

if(my_substr($theme['imgdir'], 0, 7) == 'http://' || my_substr($theme['imgdir'], 0, 8) == 'https://')

if(my_validate_url($theme['imgdir']))

{
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']))

{
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']))

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 3 characters, quit.
if(my_strlen($mybb->input['query']) < 3)

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

	{
exit;
}

	{
exit;
}

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

		$user['username'] = htmlspecialchars_uni($user['username']);
$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))

		{
$user['username'] = htmlspecialchars_uni($user['username']);
$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 278Zeile 291
{
// Verify POST request
if(!verify_post_check($mybb->get_input('my_post_key'), true))

{
// Verify POST request
if(!verify_post_check($mybb->get_input('my_post_key'), true))

	{

	{

		xmlhttp_error($lang->invalid_post_code);
}


		xmlhttp_error($lang->invalid_post_code);
}


Zeile 299Zeile 312
		);
$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);

	}
else

	}
else

	{
exit;
}

	{
exit;
}

Zeile 312Zeile 325
	if(!$forum || $forum['type'] != "f")
{
xmlhttp_error($lang->thread_doesnt_exist);

	if(!$forum || $forum['type'] != "f")
{
xmlhttp_error($lang->thread_doesnt_exist);

	}

	}


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


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

Zeile 345Zeile 358
		$ismod = true;
}
$subject = $mybb->get_input('value');

		$ismod = true;
}
$subject = $mybb->get_input('value');

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

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

	{
if(function_exists("iconv"))
{

	{
if(function_exists("iconv"))
{

Zeile 368Zeile 381
		require_once MYBB_ROOT."inc/datahandlers/post.php";
$posthandler = new PostDataHandler("update");
$posthandler->action = "post";

		require_once MYBB_ROOT."inc/datahandlers/post.php";
$posthandler = new PostDataHandler("update");
$posthandler->action = "post";





		// Set the post data that came from the input to the $post array.
$updatepost = array(
"pid" => $post['pid'],
"tid" => $thread['tid'],

		// Set the post data that came from the input to the $post array.
$updatepost = array(
"pid" => $post['pid'],
"tid" => $thread['tid'],

 
			"prefix" => $thread['prefix'],

			"subject" => $subject,
"edit_uid" => $mybb->user['uid']
);

			"subject" => $subject,
"edit_uid" => $mybb->user['uid']
);

Zeile 435Zeile 449

// Missing thread, invalid forum? Error.
if(!$thread || !$forum || $forum['type'] != "f")


// Missing thread, invalid forum? Error.
if(!$thread || !$forum || $forum['type'] != "f")

	{

	{

		xmlhttp_error($lang->thread_doesnt_exist);
}


		xmlhttp_error($lang->thread_doesnt_exist);
}


Zeile 576Zeile 590
			"me_username" => $post['username'],
"filter_badwords" => 1
);

			"me_username" => $post['username'],
"filter_badwords" => 1
);

 

$post['username'] = htmlspecialchars_uni($post['username']);


if($post['smilieoff'] == 1)
{


if($post['smilieoff'] == 1)
{

Zeile 614Zeile 630
		{
$post['editdate'] = my_date('relative', TIME_NOW);
$post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);

		{
$post['editdate'] = my_date('relative', TIME_NOW);
$post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);

 
			$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);

			$post['editedprofilelink'] = build_profile_link($mybb->user['username'], $mybb->user['uid']);
$post['editreason'] = trim($editreason);
$editreason = "";

			$post['editedprofilelink'] = build_profile_link($mybb->user['username'], $mybb->user['uid']);
$post['editreason'] = trim($editreason);
$editreason = "";

Zeile 680Zeile 697
	{
$inactiveforums = "AND t.fid NOT IN ({$inactiveforums})";
}

	{
$inactiveforums = "AND t.fid NOT IN ({$inactiveforums})";
}

 

// Check group permissions if we can't view threads not started by us
$group_permissions = forum_permissions();
$onlyusfids = array();
foreach($group_permissions as $gpfid => $forum_permissions)
{
if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $gpfid;
}
}


	$message = '';

// Are we loading all quoted posts or only those not in the current thread?

	$message = '';

// Are we loading all quoted posts or only those not in the current thread?

Zeile 701Zeile 730

// Query for any posts in the list which are not within the specified thread
$query = $db->query("


// Query for any posts in the list which are not within the specified thread
$query = $db->query("

		SELECT p.subject, p.message, p.pid, p.tid, p.username, p.dateline, t.fid, p.visible, u.username AS userusername

		SELECT p.subject, p.message, p.pid, p.tid, p.username, p.dateline, t.fid, t.uid AS thread_uid, p.visible, u.username AS userusername

		FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

		FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

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

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

		if(!is_moderator($quoted_post['fid'], "canviewunapprove") && $quoted_post['visible'] == 0)





		if(
(!is_moderator($quoted_post['fid'], "canviewunapprove") && $quoted_post['visible'] == 0) ||
(!is_moderator($quoted_post['fid'], "canviewdeleted") && $quoted_post['visible'] == -1) ||
(in_array($quoted_post['fid'], $onlyusfids) && (!$mybb->user['uid'] || $quoted_post['thread_uid'] != $mybb->user['uid']))
)

		{
continue;
}

		{
continue;
}

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

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

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

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

$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($qsession['qid']);
$query = $db->query("
SELECT q.question, s.sid

	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)

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


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


	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'])));

	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'])));

		exit;

		exit;

	}
else
{

	}
else
{

Zeile 863Zeile 896
		if($validated != 1)
{
echo json_encode($lang->answer_does_not_match);

		if($validated != 1)
{
echo json_encode($lang->answer_does_not_match);

			exit;
}

			exit;
}

		else
{
echo json_encode("true");

		else
{
echo json_encode("true");

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

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

	}

	}

	else

	else

	{

	{

		// Return nothing but an OK password if passes regex
echo json_encode("true");
}

		// Return nothing but an OK password if passes regex
echo json_encode("true");
}

Zeile 896Zeile 929
	exit;
}
else if($mybb->input['action'] == "username_availability")

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

{
if(!verify_post_check($mybb->get_input('my_post_key'), true))
{

{
if(!verify_post_check($mybb->get_input('my_post_key'), true))
{

		xmlhttp_error($lang->invalid_post_code);
}


		xmlhttp_error($lang->invalid_post_code);
}


Zeile 953Zeile 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);

$plugins->run_hooks("xmlhttp_username_exists");





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





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

Zeile 1009Zeile 1046
		$offline = array();
while($buddy = $db->fetch_array($query))
{

		$offline = array();
while($buddy = $db->fetch_array($query))
{

 
			$buddy['username'] = htmlspecialchars_uni($buddy['username']);

			$buddy_name = format_name($buddy['username'], $buddy['usergroup'], $buddy['displaygroup']);
$profile_link = build_profile_link($buddy_name, $buddy['uid'], '_blank');
if($buddy['lastactive'] > $timecut && ($buddy['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $buddy['lastvisit'] != $buddy['lastactive'])

			$buddy_name = format_name($buddy['username'], $buddy['usergroup'], $buddy['displaygroup']);
$profile_link = build_profile_link($buddy_name, $buddy['uid'], '_blank');
if($buddy['lastactive'] > $timecut && ($buddy['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $buddy['lastvisit'] != $buddy['lastactive'])