aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_messenger.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_messenger.php')
-rw-r--r--phpBB/includes/functions_messenger.php38
1 files changed, 34 insertions, 4 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index a6e4cb0679..98975b9d8f 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -312,10 +312,16 @@ class messenger
/**
* Send the mail out to the recipients set previously in var $this->addresses
+ *
+ * @param int $method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
+ * @param bool $break Flag indicating if the function only formats the subject
+ * and the message without sending it
+ *
+ * @return bool
*/
function send($method = NOTIFY_EMAIL, $break = false)
{
- global $config, $user;
+ global $config, $user, $phpbb_dispatcher;
// We add some standard variables we always use, no need to specify them always
$this->assign_vars(array(
@@ -324,6 +330,30 @@ class messenger
'SITENAME' => htmlspecialchars_decode($config['sitename']),
));
+ $subject = $this->subject;
+ $message = $this->msg;
+ /**
+ * Event to modify notification message text before parsing
+ *
+ * @event core.modify_notification_message
+ * @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
+ * @var bool break Flag indicating if the function only formats the subject
+ * and the message without sending it
+ * @var string subject The message subject
+ * @var string message The message text
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'method',
+ 'break',
+ 'subject',
+ 'message',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.modify_notification_message', compact($vars)));
+ $this->subject = $subject;
+ $this->msg = $message;
+ unset($subject, $message);
+
// Parse message through template
$this->msg = trim($this->template->assign_display('body'));
@@ -625,7 +655,7 @@ class messenger
if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
- $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);
+ $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
if (!$this->jabber->connect())
{
@@ -800,7 +830,7 @@ class queue
}
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
- $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);
+ $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
if (!$this->jabber->connect())
{
@@ -1057,7 +1087,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
$options['ssl'] = array('verify_peer' => $verify_peer, 'verify_peer_name' => $verify_peer_name, 'allow_self_signed' => $allow_self_signed);
$socket_context = stream_context_create($options);
- $smtp->socket = stream_socket_client($remote_socket, $errno, $errstr, 20, STREAM_CLIENT_CONNECT, $socket_context);
+ $smtp->socket = @stream_socket_client($remote_socket, $errno, $errstr, 20, STREAM_CLIENT_CONNECT, $socket_context);
$collector->uninstall();
$error_contents = $collector->format_errors();