Vergleich inc/datahandlers/pm.php - 1.8.14 - 1.8.32

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 101Zeile 101
			$this->set_error("missing_message");
return false;
}

			$this->set_error("missing_message");
return false;
}

		return true;
}

/**










// If the length of message is beyond SQL limitation for 'text' field
else if(strlen($message) > 65535)
{
$this->set_error("message_too_long", array('65535', strlen($message)));
return false;
}

return true;
}

/**

	 * Verifies if the specified sender is valid or not.
*
* @return boolean True when valid, false when invalid.

	 * Verifies if the specified sender is valid or not.
*
* @return boolean True when valid, false when invalid.

Zeile 112Zeile 120
	function verify_sender()
{
global $db, $mybb, $lang;

	function verify_sender()
{
global $db, $mybb, $lang;





		$pm = &$this->data;

// Return if we've already validated

		$pm = &$this->data;

// Return if we've already validated

Zeile 129Zeile 137

// Check if the sender is over their quota or not - if they are, disable draft sending
if(isset($pm['options']['savecopy']) && $pm['options']['savecopy'] != 0 && empty($pm['saveasdraft']))


// Check if the sender is over their quota or not - if they are, disable draft sending
if(isset($pm['options']['savecopy']) && $pm['options']['savecopy'] != 0 && empty($pm['saveasdraft']))

		{

		{

			if($sender_permissions['pmquota'] != 0 && $sender['totalpms'] >= $sender_permissions['pmquota'] && $this->admin_override != true)
{
$pm['options']['savecopy'] = 0;

			if($sender_permissions['pmquota'] != 0 && $sender['totalpms'] >= $sender_permissions['pmquota'] && $this->admin_override != true)
{
$pm['options']['savecopy'] = 0;

Zeile 163Zeile 171
		if(array_key_exists("to", $pm))
{
foreach(array("to", "bcc") as $recipient_type)

		if(array_key_exists("to", $pm))
{
foreach(array("to", "bcc") as $recipient_type)

			{
if(!isset($pm[$recipient_type]))
{
$pm[$recipient_type] = array();
}
if(!is_array($pm[$recipient_type]))
{

			{
if(!isset($pm[$recipient_type]))
{
$pm[$recipient_type] = array();
}
if(!is_array($pm[$recipient_type]))
{

					$pm[$recipient_type] = array($pm[$recipient_type]);
}

$pm[$recipient_type] = array_map('trim', $pm[$recipient_type]);

					$pm[$recipient_type] = array($pm[$recipient_type]);
}

$pm[$recipient_type] = array_map('trim', $pm[$recipient_type]);

				$pm[$recipient_type] = array_filter($pm[$recipient_type]);

// No recipients? Skip query
if(empty($pm[$recipient_type]))
{
if($recipient_type == 'to' && !$pm['saveasdraft'])

				$pm[$recipient_type] = array_filter($pm[$recipient_type]);

// No recipients? Skip query
if(empty($pm[$recipient_type]))
{
if($recipient_type == 'to' && empty($pm['saveasdraft']))

					{
$this->set_error("no_recipients");
return false;

					{
$this->set_error("no_recipients");
return false;

Zeile 193Zeile 201
				$query = $db->simple_select('users', '*', 'username IN('.$recipientUsernames.')');

$validUsernames = array();

				$query = $db->simple_select('users', '*', 'username IN('.$recipientUsernames.')');

$validUsernames = array();


while($user = $db->fetch_array($query))
{
if($recipient_type == "bcc")


while($user = $db->fetch_array($query))
{
if($recipient_type == "bcc")

					{
$user['bcc'] = 1;
}

					{
$user['bcc'] = 1;
}

Zeile 222Zeile 230
				if(!isset($pm[$recipient_type]))
{
$pm[$recipient_type] = array();

				if(!isset($pm[$recipient_type]))
{
$pm[$recipient_type] = array();

				}

				}

				if(!is_array($pm[$recipient_type]))
{
$pm[$recipient_type] = array($pm[$recipient_type]);

				if(!is_array($pm[$recipient_type]))
{
$pm[$recipient_type] = array($pm[$recipient_type]);

Zeile 239Zeile 247
						return false;
}
continue;

						return false;
}
continue;

				}

				}


$recipientUids = "'".implode("','", $pm[$recipient_type])."'";



$recipientUids = "'".implode("','", $pm[$recipient_type])."'";


Zeile 301Zeile 309
				}

// Is the recipient only allowing private messages from their buddy list?

				}

// Is the recipient only allowing private messages from their buddy list?

				if($mybb->settings['allowbuddyonly'] == 1 && $user['receivefrombuddy'] == 1 && !empty($user['buddylist']) && strpos(','.$user['buddylist'].',', ','.$pm['fromid'].',') === false)

				if(empty($pm['saveasdraft']) && $mybb->settings['allowbuddyonly'] == 1 && $user['receivefrombuddy'] == 1 && !empty($user['buddylist']) && strpos(','.$user['buddylist'].',', ','.$pm['fromid'].',') === false)

				{
$this->set_error('recipient_has_buddy_only', array(htmlspecialchars_uni($user['username'])));
}

				{
$this->set_error('recipient_has_buddy_only', array(htmlspecialchars_uni($user['username'])));
}

Zeile 378Zeile 386
			if(isset($user['bcc']) && $user['bcc'] == 1)
{
$pm['recipients'][$user['uid']]['bcc'] = 1;

			if(isset($user['bcc']) && $user['bcc'] == 1)
{
$pm['recipients'][$user['uid']]['bcc'] = 1;

			}

			}

		}
return true;
}

		}
return true;
}

Zeile 396Zeile 404

// Check if post flooding is enabled within MyBB or if the admin override option is specified.
if($mybb->settings['pmfloodsecs'] > 0 && $pm['fromid'] != 0 && $this->admin_override == false && !is_moderator(0, '', $pm['fromid']))


// Check if post flooding is enabled within MyBB or if the admin override option is specified.
if($mybb->settings['pmfloodsecs'] > 0 && $pm['fromid'] != 0 && $this->admin_override == false && !is_moderator(0, '', $pm['fromid']))

		{

		{

			// Fetch the senders profile data.
$sender = get_user($pm['fromid']);


			// Fetch the senders profile data.
$sender = get_user($pm['fromid']);


Zeile 439Zeile 447

// Requesting a read receipt?
if(isset($options['readreceipt']) && $options['readreceipt'] == 1)


// Requesting a read receipt?
if(isset($options['readreceipt']) && $options['readreceipt'] == 1)

		{

		{

			$options['readreceipt'] = 1;

			$options['readreceipt'] = 1;

		}

		}

		else
{
$options['readreceipt'] = 0;
}
return true;

		else
{
$options['readreceipt'] = 0;
}
return true;

	}

	}


/**
* Validate an entire private message.


/**
* Validate an entire private message.

Zeile 577Zeile 585
		$draftcheck = $db->fetch_array($query);

// This PM was previously a draft

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

// This PM was previously a draft

		if($draftcheck['pmid'])

		if(!empty($draftcheck['pmid']))

		{
if($draftcheck['deletetime'])
{

		{
if($draftcheck['deletetime'])
{

Zeile 621Zeile 629
			// Send email notification of new PM if it is enabled for the recipient
$query = $db->simple_select("privatemessages", "dateline", "uid='".$recipient['uid']."' AND folder='1'", array('order_by' => 'dateline', 'order_dir' => 'desc', 'limit' => 1));
$lastpm = $db->fetch_array($query);

			// Send email notification of new PM if it is enabled for the recipient
$query = $db->simple_select("privatemessages", "dateline", "uid='".$recipient['uid']."' AND folder='1'", array('order_by' => 'dateline', 'order_dir' => 'desc', 'limit' => 1));
$lastpm = $db->fetch_array($query);

			if($recipient['pmnotify'] == 1 && $recipient['lastactive'] > $lastpm['dateline'])

			if($recipient['pmnotify'] == 1 && (empty($lastpm['dateline']) || $recipient['lastactive'] > $lastpm['dateline']))

			{
if($recipient['language'] != "" && $lang->language_exists($recipient['language']))
{

			{
if($recipient['language'] != "" && $lang->language_exists($recipient['language']))
{

Zeile 657Zeile 665

require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new Postparser;


require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new Postparser;

			



				$parser_options = array(
'me_username' => $pm['sender']['username'],
'filter_badwords' => 1

				$parser_options = array(
'me_username' => $pm['sender']['username'],
'filter_badwords' => 1

Zeile 727Zeile 735
		// If we're saving a copy
if($pm['options']['savecopy'] != 0)
{

		// If we're saving a copy
if($pm['options']['savecopy'] != 0)
{

			if(isset($recipient_list['to']) && count($recipient_list['to']) == 1)

			if(isset($recipient_list['to']) && is_array($recipient_list['to']) && count($recipient_list['to']) == 1)

			{
$this->pm_insert_data['toid'] = $uid;
}

			{
$this->pm_insert_data['toid'] = $uid;
}