Browse Source

+ disallow_sendBody removes the body from PMs too [Bug 4834]

emanuele 13 years ago
parent
commit
18c41a8aa6

+ 8 - 3
Sources/Subs-Post.php

@@ -1107,9 +1107,14 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
 		);
 	}
 
-	censorText($message);
 	censorText($subject);
-	$message = trim(un_htmlspecialchars(strip_tags(strtr(parse_bbc(htmlspecialchars($message), false), array('<br />' => "\n", '</div>' => "\n", '</li>' => "\n", '&#91;' => '[', '&#93;' => ']')))));
+	if (empty($modSettings['disallow_sendBody']))
+	{
+		censorText($message);
+		$message = trim(un_htmlspecialchars(strip_tags(strtr(parse_bbc(htmlspecialchars($message), false), array('<br />' => "\n", '</div>' => "\n", '</li>' => "\n", '&#91;' => '[', '&#93;' => ']')))));
+	}
+	else
+		$message = '';
 
 	foreach ($notifications as $lang => $notification_list)
 	{
@@ -1118,7 +1123,7 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
 
 		// Replace the right things in the message strings.
 		$mailsubject = str_replace(array('SUBJECT', 'SENDER'), array($subject, un_htmlspecialchars($from['name'])), $txt['new_pm_subject']);
-		$mailmessage = str_replace(array('SUBJECT', 'MESSAGE', 'SENDER'), array($subject, $message, un_htmlspecialchars($from['name'])), $txt['pm_email']);
+		$mailmessage = str_replace(array('SUBJECT', 'MESSAGE', 'SENDER'), array($subject, $message, un_htmlspecialchars($from['name'])), $txt['pm_email'] . (empty($modSettings['disallow_sendBody']) ? $txt['pm_email_body'] : ''));
 		$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm;sa=send;f=inbox;pmsg=' . $id_pm . ';quote;u=' . $from['id'];
 
 		// Off the notification email goes!

+ 1 - 1
Themes/default/languages/Help.english.php

@@ -285,7 +285,7 @@ $helptxt['cache_cachedir'] = 'This setting This is only for the smf file based c
 $helptxt['enableErrorLogging'] = 'This will log any errors, like a failed login, so you can see what went wrong.';
 $helptxt['enableErrorQueryLogging'] = 'This will include the full query sent to the database in the error log.  Requires error logging to be turned on.<br /><br /><strong>Note:  This will affect the ability to filter the error log by the error message.</strong>';
 $helptxt['allow_disableAnnounce'] = 'This will allow users to opt out of notification of topics you announce by checking the &quot;announce topic&quot; checkbox when posting.';
-$helptxt['disallow_sendBody'] = 'This option removes the option to receive the text of replies and posts in notification emails.<br /><br />Often, members will reply to the notification email, which in most cases means the webmaster receives the reply.';
+$helptxt['disallow_sendBody'] = 'This option removes the option to receive the text of replies, posts and personal messages in notification emails.<br /><br />Often, members will reply to the notification email, which in most cases means the webmaster receives the reply.';
 $helptxt['jquery_source'] = 'This will determine the source used to load the Jquery Library.  Auto will use the CDN first and if not available fall back to the local source.  Local will only use the local source, CDN will only load it from Googles CDN network';
 $helptxt['compactTopicPagesEnable'] = 'This will just show a selection of the number of pages.<br /><em>Example:</em>
 		&quot;3&quot; to display: 1 ... 4 [5] 6 ... 9 <br />

+ 2 - 1
Themes/default/languages/PersonalMessage.english.php

@@ -22,7 +22,8 @@ $txt['recipient'] = 'Recipient';
 // Don't translate the word "SUBJECT" here, as it is used to format the message - use numeric entities as well.
 $txt['new_pm_subject'] = 'New Personal Message: SUBJECT';
 // Don't translate SENDER or MESSAGE in this language string; they are replaced with the corresponding text - use numeric entities too.
-$txt['pm_email'] = 'You have just been sent a personal message by SENDER on ' . $context['forum_name'] . '.' . "\n\n" . 'IMPORTANT: Remember, this is just a notification. Please do not reply to this email.' . "\n\n" . 'The message they sent you was:' . "\n\n" . 'MESSAGE';
+$txt['pm_email'] = 'You have just been sent a personal message by SENDER on ' . $context['forum_name'] . '.' . "\n\n" . 'IMPORTANT: Remember, this is just a notification. Please do not reply to this email.';
+$txt['pm_email_body'] = "\n\n" . 'The message they sent you was:' . "\n\n" . 'MESSAGE';
 $txt['pm_multiple'] = '(multiple recipients: \'name1, name2\')';
 // Use numeric entities in the below string.
 $txt['instant_reply'] = 'Reply to this Personal Message here:';