Vergleich private.php - 1.8.4 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 49Zeile 49
		 "pmfolders" => $mybb->user['pmfolders']
);
$db->update_query("users", $sql_array, "uid = ".$mybb->user['uid']);

		 "pmfolders" => $mybb->user['pmfolders']
);
$db->update_query("users", $sql_array, "uid = ".$mybb->user['uid']);

}

// On a random occassion, recount the user's pms just to make sure everything is in sync.
$rand = my_rand(0, 9);
if($rand == 5)
{
update_pm_count();

 
}

$mybb->input['fid'] = $mybb->get_input('fid', MyBB::INPUT_INT);

}

$mybb->input['fid'] = $mybb->get_input('fid', MyBB::INPUT_INT);

Zeile 457Zeile 450
		if(!trim($message['subject']))
{
$message['subject'] = $lang->pm_no_subject;

		if(!trim($message['subject']))
{
$message['subject'] = $lang->pm_no_subject;

		}

$message['subject'] = $parser->parse_badwords($message['subject']);

		}

$message['subject'] = $parser->parse_badwords($message['subject']);


if(my_strlen($message['subject']) > 50)
{
$message['subject'] = htmlspecialchars_uni(my_substr($message['subject'], 0, 50)."...");


if(my_strlen($message['subject']) > 50)
{
$message['subject'] = htmlspecialchars_uni(my_substr($message['subject'], 0, 50)."...");

		}

		}

		else

		else

		{

		{

			$message['subject'] = htmlspecialchars_uni($message['subject']);

			$message['subject'] = htmlspecialchars_uni($message['subject']);

		}

		}


if($message['folder'] != "3")
{
$senddate = my_date('relative', $message['dateline']);


if($message['folder'] != "3")
{
$senddate = my_date('relative', $message['dateline']);

		}

		}

		else
{
$senddate = $lang->not_sent;

		else
{
$senddate = $lang->not_sent;

Zeile 507Zeile 500

eval("\$results = \"".$templates->get("private_search_results")."\";");
output_page($results);


eval("\$results = \"".$templates->get("private_search_results")."\";");
output_page($results);

}


}


if($mybb->input['action'] == "advanced_search")

if($mybb->input['action'] == "advanced_search")

{

{

	$plugins->run_hooks("private_advanced_search");

	$plugins->run_hooks("private_advanced_search");





	eval("\$advanced_search = \"".$templates->get("private_advanced_search")."\";");

	eval("\$advanced_search = \"".$templates->get("private_advanced_search")."\";");





	output_page($advanced_search);
}


	output_page($advanced_search);
}


Zeile 522Zeile 515
if($mybb->input['action'] == "dismiss_notice")
{
if($mybb->user['pmnotice'] != 2)

if($mybb->input['action'] == "dismiss_notice")
{
if($mybb->user['pmnotice'] != 2)

	{
exit;

	{
exit;

	}

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

	}

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	$updated_user = array(
"pmnotice" => 1
);

	$updated_user = array(
"pmnotice" => 1
);

Zeile 540Zeile 533
		exit;
}
else

		exit;
}
else

	{

	{

		header("Location: index.php");
exit;

		header("Location: index.php");
exit;

	}

	}

}


}


$send_errors = '';


$send_errors = '';


if($mybb->input['action'] == "do_send" && $mybb->request_method == "post")
{
if($mybb->usergroup['cansendpms'] == 0)

if($mybb->input['action'] == "do_send" && $mybb->request_method == "post")
{
if($mybb->usergroup['cansendpms'] == 0)

Zeile 557Zeile 550

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	$plugins->run_hooks("private_send_do_send");

// Attempt to see if this PM is a duplicate or not

	$plugins->run_hooks("private_send_do_send");

// Attempt to see if this PM is a duplicate or not

 
	$to = array_map("trim", explode(",", $mybb->get_input('to')));
$to_escaped = implode("','", array_map(array($db, 'escape_string'), array_map('my_strtolower', $to)));

	$time_cutoff = TIME_NOW - (5 * 60 * 60);
$query = $db->query("
SELECT pm.pmid
FROM ".TABLE_PREFIX."privatemessages pm
LEFT JOIN ".TABLE_PREFIX."users u ON(u.uid=pm.toid)

	$time_cutoff = TIME_NOW - (5 * 60 * 60);
$query = $db->query("
SELECT pm.pmid
FROM ".TABLE_PREFIX."privatemessages pm
LEFT JOIN ".TABLE_PREFIX."users u ON(u.uid=pm.toid)

		WHERE LOWER(u.username)='".$db->escape_string(my_strtolower($mybb->get_input('to')))."' AND pm.dateline > {$time_cutoff} AND pm.fromid='{$mybb->user['uid']}' AND pm.subject='".$db->escape_string($mybb->get_input('subject'))."' AND pm.message='".$db->escape_string($mybb->get_input('message'))."' AND pm.folder!='3'


		WHERE LOWER(u.username) IN ('{$to_escaped}') AND pm.dateline > {$time_cutoff} AND pm.fromid='{$mybb->user['uid']}' AND pm.subject='".$db->escape_string($mybb->get_input('subject'))."' AND pm.message='".$db->escape_string($mybb->get_input('message'))."' AND pm.folder!='3'
LIMIT 0, 1

	");
$duplicate_check = $db->fetch_field($query, "pmid");
if($duplicate_check)

	");
$duplicate_check = $db->fetch_field($query, "pmid");
if($duplicate_check)

Zeile 588Zeile 584
	);

// Split up any recipients we have

	);

// Split up any recipients we have

	$pm['to'] = explode(",", $mybb->get_input('to'));
$pm['to'] = array_map("trim", $pm['to']);

	$pm['to'] = $to;


	if(!empty($mybb->input['bcc']))
{
$pm['bcc'] = explode(",", $mybb->get_input('bcc'));
$pm['bcc'] = array_map("trim", $pm['bcc']);

	if(!empty($mybb->input['bcc']))
{
$pm['bcc'] = explode(",", $mybb->get_input('bcc'));
$pm['bcc'] = array_map("trim", $pm['bcc']);

	}

$mybb->input['options'] = $mybb->get_input('options', MyBB::INPUT_ARRAY);

	}

$mybb->input['options'] = $mybb->get_input('options', MyBB::INPUT_ARRAY);


if(!$mybb->usergroup['cantrackpms'])


if(!$mybb->usergroup['cantrackpms'])

	{

	{

		$mybb->input['options']['readreceipt'] = false;

		$mybb->input['options']['readreceipt'] = false;

	}

	}


$pm['options'] = array();
if(isset($mybb->input['options']['signature']) && $mybb->input['options']['signature'] == 1)


$pm['options'] = array();
if(isset($mybb->input['options']['signature']) && $mybb->input['options']['signature'] == 1)

	{

	{

		$pm['options']['signature'] = 1;

		$pm['options']['signature'] = 1;

	}

	}

	else
{
$pm['options']['signature'] = 0;
}
if(isset($mybb->input['options']['disablesmilies']))

	else
{
$pm['options']['signature'] = 0;
}
if(isset($mybb->input['options']['disablesmilies']))

	{

	{

		$pm['options']['disablesmilies'] = $mybb->input['options']['disablesmilies'];

		$pm['options']['disablesmilies'] = $mybb->input['options']['disablesmilies'];

	}

	}

	if(isset($mybb->input['options']['savecopy']) && $mybb->input['options']['savecopy'] == 1)

	if(isset($mybb->input['options']['savecopy']) && $mybb->input['options']['savecopy'] == 1)

	{

	{

		$pm['options']['savecopy'] = 1;

		$pm['options']['savecopy'] = 1;

	}

	}

	else

	else

	{

	{

		$pm['options']['savecopy'] = 0;

		$pm['options']['savecopy'] = 0;

	}

	}

	if(isset($mybb->input['options']['readreceipt']))

	if(isset($mybb->input['options']['readreceipt']))

	{

	{

		$pm['options']['readreceipt'] = $mybb->input['options']['readreceipt'];
}

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

		$pm['options']['readreceipt'] = $mybb->input['options']['readreceipt'];
}

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

	{

	{

		$pm['saveasdraft'] = 1;
}
$pmhandler->set_data($pm);

		$pm['saveasdraft'] = 1;
}
$pmhandler->set_data($pm);

Zeile 663Zeile 658
	if($mybb->usergroup['cansendpms'] == 0)
{
error_no_permission();

	if($mybb->usergroup['cansendpms'] == 0)
{
error_no_permission();

	}

	}


$plugins->run_hooks("private_send_start");



$plugins->run_hooks("private_send_start");


Zeile 697Zeile 692
		if(isset($options['disablesmilies']) && $options['disablesmilies'] == 1)
{
$optionschecked['disablesmilies'] = 'checked="checked"';

		if(isset($options['disablesmilies']) && $options['disablesmilies'] == 1)
{
$optionschecked['disablesmilies'] = 'checked="checked"';

		}

		}

		if(isset($options['savecopy']) && $options['savecopy'] != 0)
{
$optionschecked['savecopy'] = 'checked="checked"';

		if(isset($options['savecopy']) && $options['savecopy'] != 0)
{
$optionschecked['savecopy'] = 'checked="checked"';

Zeile 730Zeile 725
		$post['subject'] = htmlspecialchars_uni($mybb->get_input('subject'));
$post['icon'] = $mybb->get_input('icon', MyBB::INPUT_INT);
if(!isset($options['disablesmilies']))

		$post['subject'] = htmlspecialchars_uni($mybb->get_input('subject'));
$post['icon'] = $mybb->get_input('icon', MyBB::INPUT_INT);
if(!isset($options['disablesmilies']))

		{

		{

			$options['disablesmilies'] = 0;
}
$post['smilieoff'] = $options['disablesmilies'];

			$options['disablesmilies'] = 0;
}
$post['smilieoff'] = $options['disablesmilies'];

Zeile 763Zeile 758

$postbit = build_postbit($post, 2);
eval("\$preview = \"".$templates->get("previewpost")."\";");


$postbit = build_postbit($post, 2);
eval("\$preview = \"".$templates->get("previewpost")."\";");

	}

	}

	else if(!$send_errors)
{
// New PM, so load default settings

	else if(!$send_errors)
{
// New PM, so load default settings

Zeile 796Zeile 791
		{
// message saved in drafts
$mybb->input['uid'] = $pm['toid'];

		{
// message saved in drafts
$mybb->input['uid'] = $pm['toid'];





			if($pm['includesig'] == 1)
{
$optionschecked['signature'] = 'checked="checked"';

			if($pm['includesig'] == 1)
{
$optionschecked['signature'] = 'checked="checked"';

Zeile 830Zeile 825
					$recipient_list['bcc'][] = $recipient;
$recipientids .= $comma.$recipient;
$comma = ',';

					$recipient_list['bcc'][] = $recipient;
$recipientids .= $comma.$recipient;
$comma = ',';

				}

				}

			}

if(!empty($recipientids))

			}

if(!empty($recipientids))

Zeile 839Zeile 834
				while($user = $db->fetch_array($query))
{
if(isset($recipients['bcc']) && is_array($recipients['bcc']) && in_array($user['uid'], $recipient_list['bcc']))

				while($user = $db->fetch_array($query))
{
if(isset($recipients['bcc']) && is_array($recipients['bcc']) && in_array($user['uid'], $recipient_list['bcc']))

					{

					{

						$bcc .= htmlspecialchars_uni($user['username']).', ';

						$bcc .= htmlspecialchars_uni($user['username']).', ';

					}

					}

					else
{
$to .= htmlspecialchars_uni($user['username']).', ';
}
}

					else
{
$to .= htmlspecialchars_uni($user['username']).', ';
}
}

			}

			}

		}
else
{

		}
else
{

Zeile 856Zeile 851
			$message = "[quote='{$pm['quotename']}']\n$message\n[/quote]";
$message = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $message);


			$message = "[quote='{$pm['quotename']}']\n$message\n[/quote]";
$message = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $message);


			require_once MYBB_ROOT."inc/functions_posting.php";


			require_once MYBB_ROOT."inc/functions_posting.php";


			if($mybb->settings['maxpmquotedepth'] != '0')

			if($mybb->settings['maxpmquotedepth'] != '0')

			{

			{

				$message = remove_message_quotes($message, $mybb->settings['maxpmquotedepth']);
}

if($mybb->input['do'] == 'forward')

				$message = remove_message_quotes($message, $mybb->settings['maxpmquotedepth']);
}

if($mybb->input['do'] == 'forward')

			{

			{

				$subject = "Fw: $subject";
}
elseif($mybb->input['do'] == 'reply')

				$subject = "Fw: $subject";
}
elseif($mybb->input['do'] == 'reply')

Zeile 981Zeile 976
	if(!$pm)
{
error($lang->error_invalidpm);

	if(!$pm)
{
error($lang->error_invalidpm);

	}

	}


if($pm['folder'] == 3)
{


if($pm['folder'] == 3)
{

Zeile 998Zeile 993
		'image' => 'groupimage',
'namestyle' => 'namestyle'
);

		'image' => 'groupimage',
'namestyle' => 'namestyle'
);





	foreach($data_key as $field => $key)

	foreach($data_key as $field => $key)

	{

	{

		$pm[$key] = $groupscache[$pm['usergroup']][$field];

		$pm[$key] = $groupscache[$pm['usergroup']][$field];

	}

	}


if($pm['receipt'] == 1)
{
if($mybb->usergroup['candenypmreceipts'] == 1 && $mybb->get_input('denyreceipt', MyBB::INPUT_INT) == 1)


if($pm['receipt'] == 1)
{
if($mybb->usergroup['candenypmreceipts'] == 1 && $mybb->get_input('denyreceipt', MyBB::INPUT_INT) == 1)

		{

		{

			$receiptadd = 0;

			$receiptadd = 0;

		}

		}

		else
{
$receiptadd = 2;

		else
{
$receiptadd = 2;

		}
}

		}
}


$action_time = '';
if($pm['status'] == 0)


$action_time = '';
if($pm['status'] == 0)

Zeile 1024Zeile 1019
			'status' => 1,
'readtime' => $time
);

			'status' => 1,
'readtime' => $time
);





		if(isset($receiptadd))
{
$updatearray['receipt'] = $receiptadd;

		if(isset($receiptadd))
{
$updatearray['receipt'] = $receiptadd;

		}

$db->update_query('privatemessages', $updatearray, "pmid='{$pmid}'");

		}

$db->update_query('privatemessages', $updatearray, "pmid='{$pmid}'");


// Update the unread count - it has now changed.
update_pm_count($mybb->user['uid'], 6);


// Update the unread count - it has now changed.
update_pm_count($mybb->user['uid'], 6);

Zeile 1063Zeile 1058
	{
$forward_string = $lang->you_forwarded_on;
$forward_date = my_date('relative', $pm['statustime']);

	{
$forward_string = $lang->you_forwarded_on;
$forward_date = my_date('relative', $pm['statustime']);





		if((TIME_NOW - $pm['statustime']) < 3600)
{
$forward_string = $lang->you_forwarded;

		if((TIME_NOW - $pm['statustime']) < 3600)
{
$forward_string = $lang->you_forwarded;

Zeile 1079Zeile 1074
	if($pm['fromid'] == 0)
{
$pm['username'] = $lang->mybb_engine;

	if($pm['fromid'] == 0)
{
$pm['username'] = $lang->mybb_engine;

	}

	}


if(!$pm['username'])
{


if(!$pm['username'])
{

Zeile 1109Zeile 1104
	}

// Fetch recipient names from the database

	}

// Fetch recipient names from the database

	$bcc_recipients = $to_recipients = array();

	$bcc_recipients = $to_recipients = $bcc_form_val = array();

	$query = $db->simple_select('users', 'uid, username', "uid IN ({$uid_sql})");
while($recipient = $db->fetch_array($query))
{

	$query = $db->simple_select('users', 'uid, username', "uid IN ({$uid_sql})");
while($recipient = $db->fetch_array($query))
{

Zeile 1117Zeile 1112
		if($show_bcc && in_array($recipient['uid'], $pm['recipients']['bcc']))
{
$bcc_recipients[] = build_profile_link($recipient['username'], $recipient['uid']);

		if($show_bcc && in_array($recipient['uid'], $pm['recipients']['bcc']))
{
$bcc_recipients[] = build_profile_link($recipient['username'], $recipient['uid']);

 
			$bcc_form_val[] = $recipient['username'];

		}
// User is a normal recipient
else if(in_array($recipient['uid'], $pm['recipients']['to']))

		}
// User is a normal recipient
else if(in_array($recipient['uid'], $pm['recipients']['to']))

Zeile 1129Zeile 1125
	if(count($bcc_recipients) > 0)
{
$bcc_recipients = implode(', ', $bcc_recipients);

	if(count($bcc_recipients) > 0)
{
$bcc_recipients = implode(', ', $bcc_recipients);

 
		$bcc_form_val = implode(',', $bcc_form_val);

		eval("\$bcc = \"".$templates->get("private_read_bcc")."\";");

		eval("\$bcc = \"".$templates->get("private_read_bcc")."\";");

 
	}
else
{
$bcc_form_val = '';

	}

$replyall = false;

	}

$replyall = false;

Zeile 1140Zeile 1141

if(count($to_recipients) > 0)
{


if(count($to_recipients) > 0)
{

		$to_recipients = implode(", ", $to_recipients);

		$to_recipients = implode($lang->comma, $to_recipients);

	}
else
{

	}
else
{

Zeile 2060Zeile 2061
	}
else
{

	}
else
{

 
		echo "\xEF\xBB\xBF"; // UTF-8 BOM

		echo $archived;
}
}

		echo $archived;
}
}