Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"version": "v3.4.2",
"require": {
"saucebase/core": "^2.0"
"saucebase/core": "^2.7"
},
"authors": [
{
Expand Down
12 changes: 2 additions & 10 deletions src/Notifications/RoadmapItemStatusChangedNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Modules\Roadmap\Models\RoadmapItem;
use Saucebase\Core\Support\Markdown;

class RoadmapItemStatusChangedNotification extends Notification implements ShouldQueue
{
Expand All @@ -29,21 +30,12 @@
return (new MailMessage)
->subject(__('Your roadmap item status has been updated'))
->greeting(__('Hello :name,', ['name' => $notifiable->name]))
->line(__('The status of your roadmap item **":title"** has been updated.', ['title' => $this->escapeMarkdown($this->item->title)]))
->line(__('The status of your roadmap item **":title"** has been updated.', ['title' => Markdown::escape($this->item->title)]))

Check warning on line 33 in src/Notifications/RoadmapItemStatusChangedNotification.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 139 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_roadmap&issues=AaGJig8qyaO9ZP8S-jsJ&open=AaGJig8qyaO9ZP8S-jsJ&pullRequest=17
->line(__('New status: **:status**', ['status' => $this->item->status->getLabel()]))
->action(__('View Roadmap'), route('roadmap.index'))
->line(__('Thank you for your feedback!'));
}

/**
* Mail lines are rendered as Markdown, so a title someone typed could
* otherwise turn itself into a link in the reader's inbox.
*/
private function escapeMarkdown(string $text): string
{
return preg_replace('/([\\\\`*_{}\[\]()#+\-.!|>~])/', '\\\\$1', $text) ?? $text;
}

/**
* @return array<string, mixed>
*/
Expand Down
Loading