From 85ae5e7125087ef056b4ad3fc96d7a21c8758c6b Mon Sep 17 00:00:00 2001 From: roble Date: Thu, 29 Oct 2026 10:40:31 +0000 Subject: [PATCH] fix: update composer dependency and improve markdown escaping in notification --- composer.json | 2 +- .../RoadmapItemStatusChangedNotification.php | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 1182421..e165393 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "version": "v3.4.2", "require": { - "saucebase/core": "^2.0" + "saucebase/core": "^2.7" }, "authors": [ { diff --git a/src/Notifications/RoadmapItemStatusChangedNotification.php b/src/Notifications/RoadmapItemStatusChangedNotification.php index d3e8ada..5971d14 100644 --- a/src/Notifications/RoadmapItemStatusChangedNotification.php +++ b/src/Notifications/RoadmapItemStatusChangedNotification.php @@ -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 { @@ -29,21 +30,12 @@ public function toMail(object $notifiable): MailMessage 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)])) ->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 */