phpBB

Code Changes

File: includes/ucp/ucp_pm_compose.php

  Unmodified   Added   Modified   Removed
Line 308Line 308
		$result = $db->sql_query($sql);
$post = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

		$result = $db->sql_query($sql);
$post = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

 

/**
* Alter the row of the post being quoted when composing a private message
*
* @event core.ucp_pm_compose_compose_pm_basic_info_query_after
* @var array post Array with data of the post being quoted
* @var int msg_id topic_id in the page request
* @var int to_user_id The id of whom the message is to
* @var int to_group_id The id of the group whom the message is to
* @var bool submit Whether the user is sending the PM or not
* @var bool preview Whether the user is previewing the PM or not
* @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies
* @var bool delete Whether the user is deleting the PM
* @var int reply_to_all Value of reply_to_all request variable.
* @since 3.2.10-RC1
* @since 3.3.1-RC1
*/
$vars = [
'post',
'msg_id',
'to_user_id',
'to_group_id',
'submit',
'preview',
'action',
'delete',
'reply_to_all',
];
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_compose_pm_basic_info_query_after', compact($vars)));


if (!$post)
{


if (!$post)
{

Line 657Line 686
	$img_status		= ($config['auth_img_pm'] && $auth->acl_get('u_pm_img')) ? true : false;
$flash_status = ($config['auth_flash_pm'] && $auth->acl_get('u_pm_flash')) ? true : false;
$url_status = ($config['allow_post_links']) ? true : false;

	$img_status		= ($config['auth_img_pm'] && $auth->acl_get('u_pm_img')) ? true : false;
$flash_status = ($config['auth_flash_pm'] && $auth->acl_get('u_pm_flash')) ? true : false;
$url_status = ($config['allow_post_links']) ? true : false;

 

/**
* Event to override private message BBCode status indications
*
* @event core.ucp_pm_compose_modify_bbcode_status
*
* @var bool bbcode_status BBCode status
* @var bool smilies_status Smilies status
* @var bool img_status Image BBCode status
* @var bool flash_status Flash BBCode status
* @var bool url_status URL BBCode status
* @since 3.3.3-RC1
*/
$vars = [
'bbcode_status',
'smilies_status',
'img_status',
'flash_status',
'url_status',
];
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_bbcode_status', compact($vars)));


// Save Draft
if ($save && $auth->acl_get('u_savedrafts'))


// Save Draft
if ($save && $auth->acl_get('u_savedrafts'))

Line 664Line 714
		$subject = $request->variable('subject', '', true);
$subject = (!$subject && $action != 'post') ? $user->lang['NEW_MESSAGE'] : $subject;
$message = $request->variable('message', '', true);

		$subject = $request->variable('subject', '', true);
$subject = (!$subject && $action != 'post') ? $user->lang['NEW_MESSAGE'] : $subject;
$message = $request->variable('message', '', true);

 

/**
* Replace Emojis and other 4bit UTF-8 chars not allowed by MySQL to UCR/NCR.
* Using their Numeric Character Reference's Hexadecimal notation.
*/
$subject = utf8_encode_ucr($subject);


if ($subject && $message)
{


if ($subject && $message)
{

Line 682Line 738
					)
);
$db->sql_query($sql);

					)
);
$db->sql_query($sql);

 

/** @var \phpbb\attachment\manager $attachment_manager */
$attachment_manager = $phpbb_container->get('attachment.manager');
$attachment_manager->delete('attach', array_column($message_parser->attachment_data, 'attach_id'));


$redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=$mode");



$redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=$mode");


Line 700Line 760
					'message'	=> $message,
'u' => $to_user_id,
'g' => $to_group_id,

					'message'	=> $message,
'u' => $to_user_id,
'g' => $to_group_id,

					'p'			=> $msg_id)
);


					'p'			=> $msg_id,
'attachment_data' => $message_parser->attachment_data,
));

				$s_hidden_fields .= build_address_field($address_list);

confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);

				$s_hidden_fields .= build_address_field($address_list);

confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);

Line 846Line 907
				$error[] = $user->lang['NO_RECIPIENT'];
}
}

				$error[] = $user->lang['NO_RECIPIENT'];
}
}

 

/**
* Modify private message
*
* @event core.ucp_pm_compose_modify_parse_after
* @var bool enable_bbcode Whether or not bbcode is enabled
* @var bool enable_smilies Whether or not smilies are enabled
* @var bool enable_urls Whether or not urls are enabled
* @var bool enable_sig Whether or not signature is enabled
* @var string subject PM subject text
* @var object message_parser The message parser object
* @var bool submit Whether or not the form has been sumitted
* @var bool preview Whether or not the signature is being previewed
* @var array error Any error strings
* @since 3.2.10-RC1
* @since 3.3.1-RC1
*/
$vars = [
'enable_bbcode',
'enable_smilies',
'enable_urls',
'enable_sig',
'subject',
'message_parser',
'submit',
'preview',
'error',
];
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_parse_after', compact($vars)));


// Store message, sync counters
if (!count($error) && $submit)


// Store message, sync counters
if (!count($error) && $submit)

Line 869Line 959
				'filename_data'			=> $message_parser->filename_data,
'address_list' => $address_list
);

				'filename_data'			=> $message_parser->filename_data,
'address_list' => $address_list
);

 

/**
* Replace Emojis and other 4bit UTF-8 chars not allowed by MySQL to UCR/NCR.
* Using their Numeric Character Reference's Hexadecimal notation.
*/
$subject = utf8_encode_ucr($subject);


// ((!$message_subject) ? $subject : $message_subject)
$msg_id = submit_pm($action, $subject, $pm_data);


// ((!$message_subject) ? $subject : $message_subject)
$msg_id = submit_pm($action, $subject, $pm_data);