Vergleich xmlhttp.php - 1.8.5 - 1.8.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 84Zeile 84
}

// Load basic theme information that we could be needing.

}

// Load basic theme information that we could be needing.

 
if($loadstyle != "def='1'")
{
$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(isset($mybb->cookies['mybbtheme']))
{
my_unsetcookie('mybbtheme');
}

$loadstyle = "def='1'";
}
}


if($loadstyle == "def='1'")
{
if(!$cache->read('default_theme'))
{
$cache->update_default_theme();
}

if($loadstyle == "def='1'")
{
if(!$cache->read('default_theme'))
{
$cache->update_default_theme();
}

 


	$theme = $cache->read('default_theme');

	$theme = $cache->read('default_theme');

}
else
{
$query = $db->simple_select("themes", "name, tid, properties", $loadstyle);
$theme = $db->fetch_array($query);

 
}

// No theme was found - we attempt to load the master or any other theme

}

// No theme was found - we attempt to load the master or any other theme

Zeile 113Zeile 125
// 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://')

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

	{

	{

		$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme
if(!empty($mybb->settings['bblanguage']))

		$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme
if(!empty($mybb->settings['bblanguage']))

		{

		{

			$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}
// Otherwise, the image language directory is the same as the language directory for the theme

			$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}
// Otherwise, the image language directory is the same as the language directory for the theme

Zeile 162Zeile 174
		// Otherwise, the image language directory is the same as the language directory for the theme
else
{

		// Otherwise, the image language directory is the same as the language directory for the theme
else
{

		$theme['imglangdir'] = $theme['imgdir'];

			$theme['imglangdir'] = $theme['imgdir'];

		}
}


		}
}


Zeile 362Zeile 374
			"pid" => $post['pid'],
"tid" => $thread['tid'],
"subject" => $subject,

			"pid" => $post['pid'],
"tid" => $thread['tid'],
"subject" => $subject,

			"edit_uid" => $mybb->user['uid']

			"edit_uid" => $mybb->user['uid']

		);
$posthandler->set_data($updatepost);


		);
$posthandler->set_data($updatepost);


Zeile 385Zeile 397
				log_moderator_action($modlogdata, $lang->edited_post);
}
}

				log_moderator_action($modlogdata, $lang->edited_post);
}
}

	}


	}


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


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


Zeile 417Zeile 429

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


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





	// Fetch the specific forum this thread/post is in.
$forum = get_forum($thread['fid']);

	// Fetch the specific forum this thread/post is in.
$forum = get_forum($thread['fid']);





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

 
	}

// Check if this forum is password protected and we have a valid password
if(check_forum_password($forum['fid'], 0, true))
{
xmlhttp_error($lang->wrong_forum_password);

	}

// Fetch forum permissions.

	}

// Fetch forum permissions.

Zeile 456Zeile 474
		{
xmlhttp_error($lang->post_moderation);
}

		{
xmlhttp_error($lang->post_moderation);
}


// Forum is closed - no editing allowed
if($forum['open'] == 0)
{
xmlhttp_error($lang->no_permission_edit_post);
}
}

$plugins->run_hooks("xmlhttp_edit_post_end");


	}

$plugins->run_hooks("xmlhttp_edit_post_end");








	if($mybb->get_input('do') == "get_post")
{
// Send our headers.

	if($mybb->get_input('do') == "get_post")
{
// Send our headers.

Zeile 479Zeile 491
	{
// 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);
}

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

			xmlhttp_error($lang->invalid_post_code);
}

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

		{

		{

			if(function_exists("iconv"))
{
$message = iconv($charset, "UTF-8//IGNORE", $message);

			if(function_exists("iconv"))
{
$message = iconv($charset, "UTF-8//IGNORE", $message);

Zeile 508Zeile 520
		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'],

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

Zeile 516Zeile 528
			"editreason" => $editreason,
"edit_uid" => $mybb->user['uid']
);

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

 

// If this is the first post set the prefix. If a forum requires a prefix the quick edit would throw an error otherwise
if($post['pid'] == $thread['firstpost'])
{
$updatepost['prefix'] = $thread['prefix'];
}


		$posthandler->set_data($updatepost);

// Now let the post handler do all the hard work.

		$posthandler->set_data($updatepost);

// Now let the post handler do all the hard work.

Zeile 764Zeile 783
else if($mybb->input['action'] == "refresh_question" && $mybb->settings['securityquestion'])
{
header("Content-type: application/json; charset={$charset}");

else if($mybb->input['action'] == "refresh_question" && $mybb->settings['securityquestion'])
{
header("Content-type: application/json; charset={$charset}");

	



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

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

	{
xmlhttp_error($lang->answer_valid_not_exists);
}

	



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

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

	require_once MYBB_ROOT."inc/functions_user.php";

	



	$sid = generate_question($qsession['qid']);
$query = $db->query("
SELECT q.question, s.sid

	$sid = generate_question($qsession['qid']);
$query = $db->query("
SELECT q.question, s.sid

Zeile 792Zeile 811
		LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid)
WHERE q.active='1' AND s.sid='{$sid}' AND q.qid!='{$qsession['qid']}'
");

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

	



	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" => htmlspecialchars_uni($question['question']), 'sid' => htmlspecialchars_uni($question['sid'])));

		exit;
}
else
{
xmlhttp_error($lang->answer_valid_not_exists);

		exit;
}
else
{
xmlhttp_error($lang->answer_valid_not_exists);

	}
}
elseif($mybb->input['action'] == "validate_question" && $mybb->settings['securityquestion'])

	}
}
elseif($mybb->input['action'] == "validate_question" && $mybb->settings['securityquestion'])

Zeile 812Zeile 831
	header("Content-type: application/json; charset={$charset}");
$sid = $db->escape_string($mybb->get_input('question'));
$answer = $db->escape_string($mybb->get_input('answer'));

	header("Content-type: application/json; charset={$charset}");
$sid = $db->escape_string($mybb->get_input('question'));
$answer = $db->escape_string($mybb->get_input('answer'));

	



	$query = $db->query("
SELECT q.*, 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}'
");

	$query = $db->query("
SELECT q.*, 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)
{
echo json_encode($lang->answer_valid_not_exists);

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

Zeile 830Zeile 849
		$question = $db->fetch_array($query);
$valid_answers = preg_split("/\r\n|\n|\r/", $question['answer']);
$validated = 0;

		$question = $db->fetch_array($query);
$valid_answers = preg_split("/\r\n|\n|\r/", $question['answer']);
$validated = 0;





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

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

Zeile 838Zeile 857
				$validated = 1;
}
}

				$validated = 1;
}
}

		



		$plugins->run_hooks("xmlhttp_validate_question");

if($validated != 1)

		$plugins->run_hooks("xmlhttp_validate_question");

if($validated != 1)

Zeile 1018Zeile 1037
/**
* Spits an XML Http based error message back to the browser
*

/**
* Spits an XML Http based error message back to the browser
*

 * @param string The message to send back.

 * @param string $message The message to send back.

 */
function xmlhttp_error($message)
{

 */
function xmlhttp_error($message)
{