@@ -844,7 +844,7 @@ public function send_notifications_reply($tid, $cur_posting, $new_pid, $post)
844844 $ mail_message = str_replace ('<topic_subject> ' , $ cur_posting ['subject ' ], $ mail_message );
845845 $ mail_message = str_replace ('<replier> ' , $ post ['username ' ], $ mail_message );
846846 $ mail_message = str_replace ('<post_url> ' , Router::pathFor ('viewPost ' , ['id ' => $ tid , 'name ' => Url::url_friendly ($ cur_posting ['subject ' ]), 'pid ' => $ new_pid ]).'#p ' .$ new_pid , $ mail_message );
847- $ mail_message = str_replace ('<unsubscribe_url> ' , Router::pathFor ('unsubscribeTopic ' , ['id ' => $ tid ]), $ mail_message );
847+ $ mail_message = str_replace ('<unsubscribe_url> ' , Router::pathFor ('unsubscribeTopic ' , ['id ' => $ tid, ' name ' => Url:: url_friendly ( $ cur_posting [ ' subject ' ]) ]), $ mail_message );
848848 $ mail_message = str_replace ('<board_mailer> ' , ForumSettings::get ('o_board_title ' ), $ mail_message );
849849 $ mail_message = Container::get ('hooks ' )->fire ('model.post.send_notifications_reply_mail_message ' , $ mail_message );
850850
@@ -853,7 +853,7 @@ public function send_notifications_reply($tid, $cur_posting, $new_pid, $post)
853853 $ mail_message_full = str_replace ('<replier> ' , $ post ['username ' ], $ mail_message_full );
854854 $ mail_message_full = str_replace ('<message> ' , $ cleaned_message , $ mail_message_full );
855855 $ mail_message_full = str_replace ('<post_url> ' , Router::pathFor ('viewPost ' , ['id ' => $ tid , 'name ' => Url::url_friendly ($ cur_posting ['subject ' ]), 'pid ' => $ new_pid ]).'#p ' .$ new_pid , $ mail_message_full );
856- $ mail_message_full = str_replace ('<unsubscribe_url> ' , Router::pathFor ('unsubscribeTopic ' , ['id ' => $ tid ]), $ mail_message_full );
856+ $ mail_message_full = str_replace ('<unsubscribe_url> ' , Router::pathFor ('unsubscribeTopic ' , ['id ' => $ tid, ' name ' => Url:: url_friendly ( $ cur_posting [ ' subject ' ]) ]), $ mail_message_full );
857857 $ mail_message_full = str_replace ('<board_mailer> ' , ForumSettings::get ('o_board_title ' ), $ mail_message_full );
858858 $ mail_message_full = Container::get ('hooks ' )->fire ('model.post.send_notifications_reply_mail_message_full ' , $ mail_message_full );
859859
@@ -1027,6 +1027,8 @@ public function send_notifications_new_topic($post, $cur_posting, $new_tid)
10271027 $ cleaned_message = Container::get ('email ' )->bbcode2email ($ post ['message ' ], -1 );
10281028 }
10291029
1030+ $ cleaned_subject = ForumSettings::get ('o_censoring ' ) == '1 ' ? $ censored_subject : $ post ['subject ' ]
1031+
10301032 // Loop through subscribed users and send emails
10311033 foreach ($ result as $ cur_subscriber ) {
10321034 // Is the subscription email for $cur_subscriber['language'] cached or not?
@@ -1049,21 +1051,21 @@ public function send_notifications_new_topic($post, $cur_posting, $new_tid)
10491051 $ mail_message_full = trim (substr ($ mail_tpl_full , $ first_crlf ));
10501052
10511053 $ mail_subject = str_replace ('<forum_name> ' , $ cur_posting ['forum_name ' ], $ mail_subject );
1052- $ mail_message = str_replace ('<topic_subject> ' , ForumSettings:: get ( ' o_censoring ' ) == ' 1 ' ? $ censored_subject : $ post [ ' subject ' ] , $ mail_message );
1054+ $ mail_message = str_replace ('<topic_subject> ' , $ cleaned_subject , $ mail_message );
10531055 $ mail_message = str_replace ('<forum_name> ' , $ cur_posting ['forum_name ' ], $ mail_message );
10541056 $ mail_message = str_replace ('<poster> ' , $ post ['username ' ], $ mail_message );
1055- $ mail_message = str_replace ('<topic_url> ' , Router::pathFor ('Topic ' , ['id ' => $ new_tid ]), $ mail_message );
1056- $ mail_message = str_replace ('<unsubscribe_url> ' , Router::pathFor ('unsubscribeTopic ' , ['id ' => $ cur_posting ['id ' ]]), $ mail_message );
1057+ $ mail_message = str_replace ('<topic_url> ' , Router::pathFor ('Topic ' , ['id ' => $ new_tid, ' name ' => Url:: url_friendly ( $ post [ ' subject ' ]) ]), $ mail_message );
1058+ $ mail_message = str_replace ('<unsubscribe_url> ' , Router::pathFor ('unsubscribeTopic ' , ['id ' => $ cur_posting ['id ' ], ' name ' => Url:: url_friendly ( $ post [ ' subject ' ]) ]), $ mail_message );
10571059 $ mail_message = str_replace ('<board_mailer> ' , ForumSettings::get ('o_board_title ' ), $ mail_message );
10581060 $ mail_message = Container::get ('hooks ' )->fire ('model.post.send_notifications_new_topic_mail_message ' , $ mail_message );
10591061
10601062 $ mail_subject_full = str_replace ('<forum_name> ' , $ cur_posting ['forum_name ' ], $ mail_subject_full );
1061- $ mail_message_full = str_replace ('<topic_subject> ' , ForumSettings:: get ( ' o_censoring ' ) == ' 1 ' ? $ censored_subject : $ post [ ' subject ' ] , $ mail_message_full );
1063+ $ mail_message_full = str_replace ('<topic_subject> ' , $ cleaned_subject , $ mail_message_full );
10621064 $ mail_message_full = str_replace ('<forum_name> ' , $ cur_posting ['forum_name ' ], $ mail_message_full );
10631065 $ mail_message_full = str_replace ('<poster> ' , $ post ['username ' ], $ mail_message_full );
10641066 $ mail_message_full = str_replace ('<message> ' , $ cleaned_message , $ mail_message_full );
1065- $ mail_message_full = str_replace ('<topic_url> ' , Router::pathFor ('Topic ' , ['id ' => $ new_tid ]), $ mail_message_full );
1066- $ mail_message_full = str_replace ('<unsubscribe_url> ' , Router::pathFor ('unsubscribeTopic ' , ['id ' => $ tid ]), $ mail_message_full );
1067+ $ mail_message_full = str_replace ('<topic_url> ' , Router::pathFor ('Topic ' , ['id ' => $ new_tid, ' name ' => Url:: url_friendly ( $ post [ ' subject ' ]) ]), $ mail_message_full );
1068+ $ mail_message_full = str_replace ('<unsubscribe_url> ' , Router::pathFor ('unsubscribeTopic ' , ['id ' => $ tid, ' name ' => Url:: url_friendly ( $ post [ ' subject ' ]) ]), $ mail_message_full );
10671069 $ mail_message_full = str_replace ('<board_mailer> ' , ForumSettings::get ('o_board_title ' ), $ mail_message_full );
10681070 $ mail_message_full = Container::get ('hooks ' )->fire ('model.post.send_notifications_new_topic_mail_message_full ' , $ mail_message_full );
10691071
0 commit comments