Skip to content

Commit cba8f0a

Browse files
Merge pull request edvinaskrucas#80 from aleemb/patch-1
Escape message for better flexibility
2 parents bdcb0a5 + 63c4721 commit cba8f0a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Krucas/Notification/Message.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,11 @@ public function position($position)
254254
*/
255255
public function render()
256256
{
257-
return is_null($this->getMessage())
258-
? '' : str_replace([':message', ':type'], [$this->getMessage(), $this->getType()], $this->getFormat());
257+
if (is_null($this->getMessage())) {
258+
return '';
259+
}
260+
$message = htmlspecialchars($this->getMessage(), ENT_QUOTES, null, false);
261+
return str_replace([':message', ':type'], [$message, $this->getType()], $this->getFormat());
259262
}
260263

261264
/**

0 commit comments

Comments
 (0)