1
0
Fork 0
mirror of synced 2024-10-01 17:58:02 +13:00

Use strip_tags to remove <p> tag

This commit is contained in:
Khushboo Verma 2024-01-11 18:54:08 +05:30
parent dc0b0c8ab7
commit d922feb4c7
2 changed files with 4 additions and 3 deletions

View file

@ -3121,8 +3121,9 @@ App::post('/v1/account/verification/phone')
$messageContent $messageContent
->setParam('{{project}}', $project->getAttribute('name')) ->setParam('{{project}}', $project->getAttribute('name'))
->setParam('{{secret}}', $secret); ->setParam('{{secret}}', $secret);
$messageContent = \strip_tags($messageContent->render());
$message = $message->setParam('{{token}}', $messageContent->render(true, Template::FILTER_ESCAPE)); $message = $message->setParam('{{token}}', $messageContent);
$message = $message->render(); $message = $message->render();
$messageDoc = new Document([ $messageDoc = new Document([

View file

@ -63,7 +63,7 @@ class Template extends View
* *
* @throws Exception * @throws Exception
*/ */
public function render($minify = true, string $filter = self::FILTER_NL2P): string public function render($minify = true): string
{ {
if ($this->rendered) { // Don't render any template if ($this->rendered) { // Don't render any template
return ''; return '';
@ -72,7 +72,7 @@ class Template extends View
if (\is_readable($this->path)) { if (\is_readable($this->path)) {
$template = \file_get_contents($this->path); // Include template file $template = \file_get_contents($this->path); // Include template file
} elseif (!empty($this->content)) { } elseif (!empty($this->content)) {
$template = $this->print($this->content, $filter); $template = $this->print($this->content);
} else { } else {
throw new Exception('"' . $this->path . '" template is not readable or not found'); throw new Exception('"' . $this->path . '" template is not readable or not found');
} }