Jelajahi Sumber

! We also need to keep the private flag passed through the mail queue otherwise PMs could accidentally become readable if they failed to send in the mail queue the first time around.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 tahun lalu
induk
melakukan
88df24d9fb
1 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 4 3
      Sources/ScheduledTasks.php

+ 4 - 3
Sources/ScheduledTasks.php

@@ -911,7 +911,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
 
 	// Now we know how many we're sending, let's send them.
 	$request = $smcFunc['db_query']('', '
-		SELECT /*!40001 SQL_NO_CACHE */ id_mail, recipient, body, subject, headers, send_html, time_sent
+		SELECT /*!40001 SQL_NO_CACHE */ id_mail, recipient, body, subject, headers, send_html, time_sent, private
 		FROM {db_prefix}mail_queue
 		ORDER BY priority ASC, id_mail ASC
 		LIMIT ' . $number,
@@ -931,6 +931,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
 			'headers' => $row['headers'],
 			'send_html' => $row['send_html'],
 			'time_sent' => $row['time_sent'],
+			'private' => $row['private'],
 		);
 	}
 	$smcFunc['db_free_result']($request);
@@ -993,7 +994,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
 
 		// Hopefully it sent?
 		if (!$result)
-			$failed_emails[] = array($email['to'], $email['body'], $email['subject'], $email['headers'], $email['send_html'], $email['time_sent']);
+			$failed_emails[] = array($email['to'], $email['body'], $email['subject'], $email['headers'], $email['send_html'], $email['time_sent'], $email['private']);
 	}
 
 	// Any emails that didn't send?
@@ -1022,7 +1023,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
 		// Add our email back to the queue, manually.
 		$smcFunc['db_insert']('insert',
 			'{db_prefix}mail_queue',
-			array('recipient' => 'string', 'body' => 'string', 'subject' => 'string', 'headers' => 'string', 'send_html' => 'string', 'time_sent' => 'string'),
+			array('recipient' => 'string', 'body' => 'string', 'subject' => 'string', 'headers' => 'string', 'send_html' => 'string', 'time_sent' => 'string', 'private' => 'int'),
 			$failed_emails,
 			array('id_mail')
 		);