| @@ -60,9 +60,9 @@ | ||
| 60 | 60 | |
| 61 | 61 | $notificationContent = \sprintf( |
| 62 | 62 | /* translators: %1$s is the user name, %2$s is the feed title and %3$3s is the space title */ |
| 63 | 63 | __('%1$s posted %2$s in %3$s', 'fluent-community'), |
| 64 | - '<b class="fcom_nudn">' . esc_html($user->display_name) . '</b>', | |
| 64 | + '<b class="fcom_nudn">' . esc_html($user->getPublicDisplayName()) . '</b>', | |
| 65 | 65 | '<span class="fcom_nft">' . $feedTitle . '</span>', |
| 66 | 66 | '<b class="fcom_nst">' . esc_html($space->title) . '</b>' |
| 67 | 67 | ); |
| 68 | 68 | |
| @@ -100,9 +100,9 @@ | ||
| 100 | 100 | if ($existingNotification) { |
| 101 | 101 | $notificationContent = \sprintf( |
| 102 | 102 | /* translators: %1$s is the user name, %2$s is the like count & %3$s is the feed title */ |
| 103 | 103 | __('%1$s and %2$s other people reacted to your post %3$s', 'fluent-community'), |
| 104 | - '<b class="fcom_nudn">' . esc_html($user->display_name) . '</b>', | |
| 104 | + '<b class="fcom_nudn">' . esc_html($user->getPublicDisplayName()) . '</b>', | |
| 105 | 105 | '<b class="fcom_nrc">' . ($feed->reactions_count - 1) . '</b>', |
| 106 | 106 | '<span class="fcom_nft">' . $feedTitle . '</span>' |
| 107 | 107 | ); |
| 108 | 108 | |
| @@ -121,9 +121,9 @@ | ||
| 121 | 121 | |
| 122 | 122 | $notificationContent = \sprintf( |
| 123 | 123 | /* translators: %1$s is the user name, %2$s is the feed title */ |
| 124 | 124 | __('%1$s reacted to your post %2$s', 'fluent-community'), |
| 125 | - '<b class="fcom_nudn">' . esc_html($user->display_name) . '</b>', | |
| 125 | + '<b class="fcom_nudn">' . esc_html($user->getPublicDisplayName()) . '</b>', | |
| 126 | 126 | '<span class="fcom_nft">' . $feedTitle . '</span>' |
| 127 | 127 | ); |
| 128 | 128 | |
| 129 | 129 | $route = $feed->getJsRoute(); |
| @@ -154,9 +154,9 @@ | ||
| 154 | 154 | if ($comment->reactions_count > 1) { |
| 155 | 155 | $notificationContent = \sprintf( |
| 156 | 156 | /* translators: %1$s is the user name, %2$s is the like count & %3$s is the comment excerpt */ |
| 157 | 157 | __('%1$s and %2$s other people reacted to your comment %3$s', 'fluent-community'), |
| 158 | - '<b class="fcom_nudn">' . esc_html($user->display_name) . '</b>', | |
| 158 | + '<b class="fcom_nudn">' . esc_html($user->getPublicDisplayName()) . '</b>', | |
| 159 | 159 | '<b class="fcom_nrc">' . ($comment->reactions_count - 1) . '</b>', |
| 160 | 160 | '<span class="fcom_nft">' . $commentExcerpt . '</span>' |
| 161 | 161 | ); |
| 162 | 162 | } else { |
| @@ -162,9 +162,9 @@ | ||
| 162 | 162 | } else { |
| 163 | 163 | $notificationContent = \sprintf( |
| 164 | 164 | /* translators: %1$s is the user name, %2$s is the comment excerpt */ |
| 165 | 165 | __('%1$s reacted to your comment %2$s', 'fluent-community'), |
| 166 | - '<b class="fcom_nudn">' . esc_html($user->display_name) . '</b>', | |
| 166 | + '<b class="fcom_nudn">' . esc_html($user->getPublicDisplayName()) . '</b>', | |
| 167 | 167 | '<span class="fcom_nft">' . $commentExcerpt . '</span>' |
| 168 | 168 | ); |
| 169 | 169 | } |
| 170 | 170 | |
| @@ -202,10 +202,10 @@ | ||
| 202 | 202 | |
| 203 | 203 | $notificationContent = \sprintf( |
| 204 | 204 | /* translators: %1$s is the role name, %2$s is the space title */ |
| 205 | 205 | __('You have been added as %1$s in %2$s', 'fluent-community'), |
| 206 | - '<b>' . $pivot->role . '</b>', | |
| 207 | - '<b>' . $space->title . '</b>' | |
| 206 | + '<b>' . esc_html($pivot->role) . '</b>', | |
| 207 | + '<b>' . esc_html($space->title) . '</b>' | |
| 208 | 208 | ); |
| 209 | 209 | |
| 210 | 210 | $route = [ |
| 211 | 211 | 'name' => 'space_feeds', |
| @@ -239,9 +239,9 @@ | ||
| 239 | 239 | if (in_array($authorId, $mentionedUserIds)) { |
| 240 | 240 | return; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - $commenter = '<b class="fcom_nudn">' . esc_html($comment->user->display_name) . '</b>'; | |
| 243 | + $commenter = '<b class="fcom_nudn">' . esc_html($comment->user->getPublicDisplayName()) . '</b>'; | |
| 244 | 244 | $feedTitle = $feed->getHumanExcerpt(60); |
| 245 | 245 | |
| 246 | 246 | $exist = null; |
| 247 | 247 | if ($feed->comments_count > 1) { |
| @@ -265,9 +265,9 @@ | ||
| 265 | 265 | __('%1$s and %2$s other people commented on your post %3$s in %4$s', 'fluent-community'), |
| 266 | 266 | $commenter, |
| 267 | 267 | '<b class="fcom_nrc">' . ($totalUsers - 1) . '</b>', |
| 268 | 268 | '<span class="fcom_nft">' . $feedTitle . '</span>', |
| 269 | - '<b class="fcom_nst">' . $feed->space->title . '</b>' | |
| 269 | + '<b class="fcom_nst">' . esc_html($feed->space->title) . '</b>' | |
| 270 | 270 | ); |
| 271 | 271 | } else { |
| 272 | 272 | $notificationContent = \sprintf( |
| 273 | 273 | /* translators: %1$s is the user name, %2$s is the feed title and %3$s space title*/ |
| @@ -273,9 +273,9 @@ | ||
| 273 | 273 | /* translators: %1$s is the user name, %2$s is the feed title and %3$s space title*/ |
| 274 | 274 | __('%1$s commented on your post: %2$s in %3$s', 'fluent-community'), |
| 275 | 275 | $commenter, |
| 276 | 276 | '<span class="fcom_nft">' . $feedTitle . '</span>', |
| 277 | - '<b class="fcom_nst">' . $feed->space->title . '</b>' | |
| 277 | + '<b class="fcom_nst">' . esc_html($feed->space->title) . '</b>' | |
| 278 | 278 | ); |
| 279 | 279 | } |
| 280 | 280 | } else { |
| 281 | 281 | |
| @@ -302,9 +302,9 @@ | ||
| 302 | 302 | /* translators: %1$s is the commenter name, %2$s is the feed title & %3$s is the space title */ |
| 303 | 303 | __('%1$s commented on your post: %2$s in %3$s', 'fluent-community'), |
| 304 | 304 | $commenter, |
| 305 | 305 | '<span class="fcom_nft">' . $feedTitle . '</span>', |
| 306 | - '<b class="fcom_nst">' . $feed->space->title . '</b>' | |
| 306 | + '<b class="fcom_nst">' . esc_html($feed->space->title) . '</b>' | |
| 307 | 307 | ); |
| 308 | 308 | } else { |
| 309 | 309 | $notificationContent = \sprintf( |
| 310 | 310 | /* translators: %1$s is the commenter name & %2$s is the feed title */ |
| @@ -390,9 +390,9 @@ | ||
| 390 | 390 | if (!$userIds && !$mentionedUserIds) { |
| 391 | 391 | return; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - $commenter = '<b class="fcom_nudn">' . esc_html($comment->user->display_name) . '</b>'; | |
| 394 | + $commenter = '<b class="fcom_nudn">' . esc_html($comment->user->getPublicDisplayName()) . '</b>'; | |
| 395 | 395 | $feedTitle = '<span class="fcom_nft">' . $feed->getHumanExcerpt(60) . '</span>'; |
| 396 | 396 | |
| 397 | 397 | $route = $feed->getJsRoute(); |
| 398 | 398 | $space = $feed->space; |
| @@ -410,9 +410,9 @@ | ||
| 410 | 410 | __('%1$s and %2$s other people also commented on %3$s in %4$s', 'fluent-community'), |
| 411 | 411 | $commenter, |
| 412 | 412 | '<b class="fcom_nrc">' . ($totalUsers - 1) . '</b>', |
| 413 | 413 | $feedTitle, |
| 414 | - '<b class="fcom_nst">' . $feed->space->title . '</b>' | |
| 414 | + '<b class="fcom_nst">' . esc_html($feed->space->title) . '</b>' | |
| 415 | 415 | ); |
| 416 | 416 | } else { |
| 417 | 417 | $notificationContent = \sprintf( |
| 418 | 418 | /* translators: %1$s is the user name, %2$s is the feed title and %3$s space title*/ |
| @@ -418,9 +418,9 @@ | ||
| 418 | 418 | /* translators: %1$s is the user name, %2$s is the feed title and %3$s space title*/ |
| 419 | 419 | __('%1$s also commented on %2$s in %3$s', 'fluent-community'), |
| 420 | 420 | $commenter, |
| 421 | 421 | $feedTitle, |
| 422 | - '<b class="fcom_nst">' . $feed->space->title . '</b>' | |
| 422 | + '<b class="fcom_nst">' . esc_html($feed->space->title) . '</b>' | |
| 423 | 423 | ); |
| 424 | 424 | } |
| 425 | 425 | } else { |
| 426 | 426 | if ($totalUsers > 1) { |
| @@ -446,9 +446,9 @@ | ||
| 446 | 446 | /* translators: %1$s is the commenter name, %2$s is the feed title & %3$s is the space title */ |
| 447 | 447 | __('%1$s also commented on %2$s in %3$s', 'fluent-community'), |
| 448 | 448 | $commenter, |
| 449 | 449 | $feedTitle, |
| 450 | - '<b class="fcom_nst">' . $space->title . '</b>' | |
| 450 | + '<b class="fcom_nst">' . esc_html($space->title) . '</b>' | |
| 451 | 451 | ); |
| 452 | 452 | } else { |
| 453 | 453 | $notificationContent = \sprintf( |
| 454 | 454 | /* translators: %1$s is the commenter name & %2$s is the feed title */ |
| @@ -532,9 +532,9 @@ | ||
| 532 | 532 | if (!$mentionedUserIds) { |
| 533 | 533 | return; |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | - $commenter = '<b class="fcom_nudn">' . esc_html($comment->user->display_name) . '</b>'; | |
| 536 | + $commenter = '<b class="fcom_nudn">' . esc_html($comment->user->getPublicDisplayName()) . '</b>'; | |
| 537 | 537 | $feedTitle = '<span class="fcom_nft">' . $feed->getHumanExcerpt(60) . '</span>'; |
| 538 | 538 | |
| 539 | 539 | $mentionNotification = Notification::create([ |
| 540 | 540 | 'feed_id' => $feed->id, |
| @@ -586,9 +586,9 @@ | ||
| 586 | 586 | if (!$childCommentUserIds) { |
| 587 | 587 | return false; |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | - $commenter = '<b class="fcom_nudn">' . esc_html($comment->user->display_name) . '</b>'; | |
| 590 | + $commenter = '<b class="fcom_nudn">' . esc_html($comment->user->getPublicDisplayName()) . '</b>'; | |
| 591 | 591 | |
| 592 | 592 | $existingNotification = Notification::where('object_id', $comment->parent_id) |
| 593 | 593 | ->where('action', 'child_comment_added') |
| 594 | 594 | ->whereHas('subscribers', function ($q) use ($childCommentUserIds) { |
| @@ -685,9 +685,9 @@ | ||
| 685 | 685 | |
| 686 | 686 | $notificationContent = \sprintf( |
| 687 | 687 | /* translators: %1$s is the user name, %2$s is the feed title */ |
| 688 | 688 | __('%1$s mentioned you in a post: %2$s', 'fluent-community'), |
| 689 | - '<b class="fcom_nudn">' . esc_html($user->display_name) . '</b>', | |
| 689 | + '<b class="fcom_nudn">' . esc_html($user->getPublicDisplayName()) . '</b>', | |
| 690 | 690 | '<b class="fcom_nft">' . $feedTitle . '</b>' |
| 691 | 691 | ); |
| 692 | 692 | |
| 693 | 693 | $route = $feed->getJsRoute(); |