Vergleich newreply.php - 1.6.4 - 1.6.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: newreply.php 5407 2011-03-20 01:41:12Z jammerx2 $

 * $Id: newreply.php 5605 2011-09-19 11:17:26Z Tomm $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 435Zeile 435
	mark_thread_read($tid, $fid);

// Check captcha image

	mark_thread_read($tid, $fid);

// Check captcha image

	if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])

	if($mybb->settings['captchaimage'] && !$mybb->user['uid'])

	{

	{

		$imagehash = $db->escape_string($mybb->input['imagehash']);
$imagestring = $db->escape_string($mybb->input['imagestring']);
$query = $db->simple_select("captcha", "*", "imagehash='$imagehash'");
$imgcheck = $db->fetch_array($query);
if(my_strtolower($imgcheck['imagestring']) != my_strtolower($imagestring) || !$imgcheck['imagehash'])
{
$post_errors[] = $lang->invalid_captcha;
}




		require_once MYBB_ROOT.'inc/class_captcha.php';
$post_captcha = new captcha(false, "post_captcha");

if($post_captcha->validate_captcha() == false)
{
// CAPTCHA validation failed
foreach($post_captcha->get_errors() as $error)
{
$post_errors[] = $error;
}
}

		else

		else

		{
$db->delete_query("captcha", "imagehash='$imagehash'");

		{


			$hide_captcha = true;
}

			$hide_captcha = true;
}

		
// if we're using AJAX, and we have a captcha, regenerate a new one




		if($mybb->input['ajax'])
{

		if($mybb->input['ajax'])
{

			$randomstr = random_str(5);
$imagehash = md5(random_str(12));
$imagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);
$db->insert_query("captcha", $imagearray);
header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>$imagehash";
if($hide_captcha)














			if($post_captcha->type == 1)
{
$randomstr = random_str(5);
$imagehash = md5(random_str(12));

$imagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);

$db->insert_query("captcha", $imagearray);

header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>$imagehash";

if($hide_captcha)
{
echo "|$randomstr";
}

echo "</captcha>";
}
else if($post_captcha->type == 2)

			{

			{

				echo "|$randomstr";


				header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>reload</captcha>";

			}

			}

			echo "</captcha>";

 
		}
}


		}
}


Zeile 604Zeile 618
				while($attachment = $db->fetch_array($query))
{
$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;

				while($attachment = $db->fetch_array($query))
{
$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;

				}

				}


// Establish altbg - may seem like this is backwards, but build_postbit reverses it
if(($postcounter - $mybb->settings['postsperpage']) % 2 != 0)


// Establish altbg - may seem like this is backwards, but build_postbit reverses it
if(($postcounter - $mybb->settings['postsperpage']) % 2 != 0)

Zeile 646Zeile 660
		}
else
{

		}
else
{

			$lang->redirect_newreply .= $lang->sprintf($lang->redirect_return_forum, get_forum_link($fid)); 

			$lang->redirect_newreply .= $lang->sprintf($lang->redirect_return_thread, get_forum_link($fid)); 

			redirect($url, $lang->redirect_newreply); 
exit;
}

			redirect($url, $lang->redirect_newreply); 
exit;
}

Zeile 750Zeile 764
			if(count($quoted_ids) > 0)
{
$quoted_ids = implode("|", $quoted_ids);

			if(count($quoted_ids) > 0)
{
$quoted_ids = implode("|", $quoted_ids);

			}
}
}


			}
}
}


	if($mybb->input['quoted_ids'])
{
$quoted_ids = htmlspecialchars_uni($mybb->input['quoted_ids']);

	if($mybb->input['quoted_ids'])
{
$quoted_ids = htmlspecialchars_uni($mybb->input['quoted_ids']);

Zeile 782Zeile 796
			$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($postoptions['subscriptionmethod'] == "instant")

			$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($postoptions['subscriptionmethod'] == "instant")

		{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}
if($postoptions['disablesmilies'] == 1)
{

		{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}
if($postoptions['disablesmilies'] == 1)
{

			$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}
$subject = $mybb->input['subject'];

			$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}
$subject = $mybb->input['subject'];

Zeile 800Zeile 814
		$message = htmlspecialchars_uni($post['message']);
$subject = $post['subject'];
if($post['includesig'] != 0)

		$message = htmlspecialchars_uni($post['message']);
$subject = $post['subject'];
if($post['includesig'] != 0)

		{

		{

			$postoptionschecked['signature'] = " checked=\"checked\"";
}
if($post['smilieoff'] == 1)

			$postoptionschecked['signature'] = " checked=\"checked\"";
}
if($post['smilieoff'] == 1)

Zeile 818Zeile 832
		if($mybb->user['subscriptionmethod'] ==  1)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";

		if($mybb->user['subscriptionmethod'] ==  1)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";

		}

		}

		else if($mybb->user['subscriptionmethod'] == 2)

		else if($mybb->user['subscriptionmethod'] == 2)

		{

		{

			$postoptions_subscriptionmethod_instant = "checked=\"checked\"";

			$postoptions_subscriptionmethod_instant = "checked=\"checked\"";

		}

		}

		else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

		else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

		}
}

		}
}


if($forum['allowpicons'] != 0)
{


if($forum['allowpicons'] != 0)
{

Zeile 1035Zeile 1049
	}

// Show captcha image for guests if enabled

	}

// Show captcha image for guests if enabled

	if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])

	if($mybb->settings['captchaimage'] && !$mybb->user['uid'])

	{
$correct = false;

	{
$correct = false;

		// If previewing a post - check their current captcha input - if correct, hide the captcha input area


		require_once MYBB_ROOT.'inc/class_captcha.php';


		if($mybb->input['previewpost'] || $hide_captcha == true)

		if($mybb->input['previewpost'] || $hide_captcha == true)

		{
$imagehash = $db->escape_string($mybb->input['imagehash']);
$imagestring = $db->escape_string($mybb->input['imagestring']);
$query = $db->simple_select("captcha", "*", "imagehash='$imagehash' AND imagestring='$imagestring'");
$imgcheck = $db->fetch_array($query);
if($imgcheck['dateline'] > 0)
{
eval("\$captcha = \"".$templates->get("post_captcha_hidden")."\";");
$correct = true;
}
else

		{
// If previewing a post - check their current captcha input - if correct, hide the captcha input area
$post_captcha = new captcha;

if($post_captcha->validate_captcha() == true)







			{

			{

				$db->delete_query("captcha", "imagehash='$imagehash'");




				$correct = true;

// Generate a hidden list of items for our captcha
$captcha = $post_captcha->build_hidden_captcha();

			}
}

			}
}

 


		if(!$correct)
{

		if(!$correct)
{

			$randomstr = random_str(5);
$imagehash = md5(random_str(12));
$imagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);
$db->insert_query("captcha", $imagearray);
eval("\$captcha = \"".$templates->get("post_captcha")."\";");

			$post_captcha = new captcha(true, "post_captcha");

if($post_captcha->html)
{
$captcha = $post_captcha->html;
}




		}
}


		}
}