fixed special chars in notifications
This commit is contained in:
parent
b65a6c6dd6
commit
3f3478b90d
@ -57,7 +57,10 @@ abstract class Notification extends BaseNotification
|
||||
|
||||
public function replaceTags($content)
|
||||
{
|
||||
return preg_replace($this->getTagsPattern(), $this->getTagsReplacement(), $content);
|
||||
$pattern = $this->getTagsPattern();
|
||||
$replacement = $this->applyQuote($this->getTagsReplacement());
|
||||
|
||||
return $this->revertQuote(preg_replace($pattern, $replacement, $content));
|
||||
}
|
||||
|
||||
public function getTagsPattern()
|
||||
@ -70,4 +73,30 @@ abstract class Notification extends BaseNotification
|
||||
|
||||
return $pattern;
|
||||
}
|
||||
|
||||
public function getTags()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getTagsReplacement()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function applyQuote($vars)
|
||||
{
|
||||
$new_vars = [];
|
||||
|
||||
foreach ($vars as $var) {
|
||||
$new_vars[] = preg_quote($var);
|
||||
}
|
||||
|
||||
return $new_vars;
|
||||
}
|
||||
|
||||
public function revertQuote($content)
|
||||
{
|
||||
return str_replace('\\', '', $content);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user