Vergleich sendthread.php - 1.8.2 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'sendthread.php');


define("IN_MYBB", 1);
define('THIS_SCRIPT', 'sendthread.php');


$templatelist = "sendthread,sendthread_fromemail,sendthread_fromemail_hidden,forumdisplay_password_wrongpass,forumdisplay_password,post_captcha";

$templatelist = "sendthread,sendthread_fromemail,forumdisplay_password_wrongpass,forumdisplay_password,post_captcha,post_captcha_nocaptcha,post_captcha_hcaptcha";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

Zeile 22Zeile 22
$lang->load("sendthread");

// Get thread info

$lang->load("sendthread");

// Get thread info

$tid = $mybb->get_input('tid', 1);

$tid = $mybb->get_input('tid', MyBB::INPUT_INT);

$thread = get_thread($tid);

// Invalid thread

$thread = get_thread($tid);

// Invalid thread

Zeile 55Zeile 55
$forumpermissions = forum_permissions($forum['fid']);

// Invalid forum?

$forumpermissions = forum_permissions($forum['fid']);

// Invalid forum?

if(!$forum['fid'] || $forum['type'] != "f")

if(!$forum || $forum['type'] != "f")

{
error($lang->error_invalidforum);
}

{
error($lang->error_invalidforum);
}

Zeile 145Zeile 145
if($mybb->input['action'] == "do_sendtofriend" && $mybb->request_method == "post")
{
// Verify incoming POST request

if($mybb->input['action'] == "do_sendtofriend" && $mybb->request_method == "post")
{
// Verify incoming POST request

	verify_post_check($mybb->input['my_post_key']);

	verify_post_check($mybb->get_input('my_post_key'));


$plugins->run_hooks("sendthread_do_sendtofriend_start");



$plugins->run_hooks("sendthread_do_sendtofriend_start");


Zeile 154Zeile 154
		$errors[] = $lang->error_invalidemail;
}


		$errors[] = $lang->error_invalidemail;
}


	if(!validate_email_format($mybb->input['fromemail']))







	if($mybb->user['uid'])
{
$mybb->input['fromemail'] = $mybb->user['email'];
$mybb->input['fromname'] = $mybb->user['username'];
}

if(!validate_email_format($mybb->input['fromemail']))

	{
$errors[] = $lang->error_invalidfromemail;

	{
$errors[] = $lang->error_invalidfromemail;

	}


	}


	if(empty($mybb->input['fromname']))

	if(empty($mybb->input['fromname']))

	{

	{

		$errors[] = $lang->error_noname;
}

if(empty($mybb->input['subject']))

		$errors[] = $lang->error_noname;
}

if(empty($mybb->input['subject']))

	{

	{

		$errors[] = $lang->error_nosubject;

		$errors[] = $lang->error_nosubject;

	}


	}


	if(empty($mybb->input['message']))

	if(empty($mybb->input['message']))

	{

	{

		$errors[] = $lang->error_nomessage;
}


		$errors[] = $lang->error_nomessage;
}


Zeile 180Zeile 186
		$captcha = new captcha;

if($captcha->validate_captcha() == false)

		$captcha = new captcha;

if($captcha->validate_captcha() == false)

		{

		{

			// CAPTCHA validation failed
foreach($captcha->get_errors() as $error)
{
$errors[] = $error;
}

			// CAPTCHA validation failed
foreach($captcha->get_errors() as $error)
{
$errors[] = $error;
}

		}

		}

	}

	}





	// No errors detected
if(count($errors) == 0)
{

	// No errors detected
if(count($errors) == 0)
{

		if($mybb->settings['mail_handler'] == 'smtp')
{
$from = $mybb->input['fromemail'];
}
else
{
$from = "{$mybb->input['fromname']} <{$mybb->input['fromemail']}>";
}


 
		$threadlink = get_thread_link($thread['tid']);

$message = $lang->sprintf($lang->email_sendtofriend, $mybb->input['fromname'], $mybb->settings['bbname'], $mybb->settings['bburl']."/".$threadlink, $mybb->input['message']);

		$threadlink = get_thread_link($thread['tid']);

$message = $lang->sprintf($lang->email_sendtofriend, $mybb->input['fromname'], $mybb->settings['bbname'], $mybb->settings['bburl']."/".$threadlink, $mybb->input['message']);





		// Send the actual message

		// Send the actual message

		my_mail($mybb->input['email'], $mybb->input['subject'], $message, $from, "", "", false, "text", "", $mybb->input['fromemail']);

		my_mail($mybb->input['email'], $mybb->input['subject'], $message, "", "", "", false, "text", "", $mybb->input['fromemail']);


if($mybb->settings['mail_logging'] > 0)
{


if($mybb->settings['mail_logging'] > 0)
{

Zeile 234Zeile 231
		$mybb->input['action'] = '';
}
}

		$mybb->input['action'] = '';
}
}





if(!$mybb->input['action'])
{
$plugins->run_hooks("sendthread_start");

if(!$mybb->input['action'])
{
$plugins->run_hooks("sendthread_start");

Zeile 248Zeile 245
		$fromemail = htmlspecialchars_uni($mybb->input['fromemail']);
$subject = htmlspecialchars_uni($mybb->input['subject']);
$message = htmlspecialchars_uni($mybb->input['message']);

		$fromemail = htmlspecialchars_uni($mybb->input['fromemail']);
$subject = htmlspecialchars_uni($mybb->input['subject']);
$message = htmlspecialchars_uni($mybb->input['message']);

	}
else

	}
else

	{
$errors = '';
$email = '';

	{
$errors = '';
$email = '';

Zeile 264Zeile 261
	{
require_once MYBB_ROOT.'inc/class_captcha.php';
$post_captcha = new captcha(true, "post_captcha");

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





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

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

	}
else
{
$captcha = '';

	}
else
{
$captcha = '';

	}

$from_email = '';
if($mybb->user['uid'] == 0)

	}

$from_email = '';
if($mybb->user['uid'] == 0)

	{

	{

		eval("\$from_email = \"".$templates->get("sendthread_fromemail")."\";");

		eval("\$from_email = \"".$templates->get("sendthread_fromemail")."\";");

	}
else
{
eval("\$from_email = \"".$templates->get("sendthread_fromemail_hidden")."\";");

 
	}

$plugins->run_hooks("sendthread_end");

	}

$plugins->run_hooks("sendthread_end");