Browse Source

! Don't use $scripturl directly in alerts. For emails it's fine because they are less likely to linger, but for alerts they can hang around a while, e.g. if a user doesn't log in before a site move, and the user then logs in. Emails are by nature a bit more transient like that.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 years ago
parent
commit
f0fafdfa02

+ 2 - 2
Sources/Profile-View.php

@@ -322,8 +322,8 @@ function fetch_alerts($memID, $all = false)
 		if (isset($txt[$string]))
 		{
 			$extra = $alerts[$id_alert]['extra'];
-			$search = array('{member_link}');
-			$repl = array(!empty($alert['sender_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $alert['sender_id'] . '">' . $alert['sender_name'] . '</a>' : $alert['sender_name']);
+			$search = array('{member_link}', '{scripturl}');
+			$repl = array(!empty($alert['sender_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $alert['sender_id'] . '">' . $alert['sender_name'] . '</a>' : $alert['sender_name'], $scripturl);
 			foreach ($extra as $k => $v)
 			{
 				$search[] = '{' . $k . '}';

+ 1 - 1
Sources/tasks/MsgReport-Notify.php

@@ -97,7 +97,7 @@ class MsgReport_Notify_Background extends SMF_BackgroundTask
 					'is_read' => 0,
 					'extra' => serialize(
 						array(
-							'report_link' => $scripturl . '?action=moderate;area=reports;report=' . $this->_details['report_id'],
+							'report_link' => '?action=moderate;area=reports;report=' . $this->_details['report_id'], // We don't put $scripturl in these!
 						)
 					),
 				);

+ 1 - 1
Sources/tasks/MsgReportReply-Notify.php

@@ -127,7 +127,7 @@ class MsgReportReply_Notify_Background extends SMF_BackgroundTask
 					'is_read' => 0,
 					'extra' => serialize(
 						array(
-							'report_link' => $scripturl . '?action=moderate;area=reports;report=' . $this->_details['report_id'],
+							'report_link' => '?action=moderate;area=reports;report=' . $this->_details['report_id'], // We don't put $scripturl in these!
 						)
 					),
 				);

+ 2 - 2
Themes/default/languages/Alerts.english.php

@@ -11,8 +11,8 @@ $txt['alert_settings'] = 'Settings';
 $txt['alerts_no_unread'] = 'No unread alerts.';
 
 $txt['alert_msg_like'] = '{member_link} liked your post {msg_msg}';
-$txt['alert_msg_report'] = '{member_link} <a href="{report_link}">reported a post</a> - {msg_msg}';
-$txt['alert_msg_report_reply'] = '{member_link} replied to <a href="{report_link}">the report</a> about {msg_msg}';
+$txt['alert_msg_report'] = '{member_link} <a href="{scripturl}{report_link}">reported a post</a> - {msg_msg}';
+$txt['alert_msg_report_reply'] = '{member_link} replied to <a href="{scripturl}{report_link}">the report</a> about {msg_msg}';
 $txt['alert_member_register_standard'] = '{member_link} just signed up';
 $txt['alert_member_register_approval'] = '{member_link} just signed up (account requires approval)';
 $txt['alert_member_register_activation'] = '{member_link} just signed up (account requires activation)';