diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Utils/Formatter.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Utils/Formatter.php b/src/Utils/Formatter.php index f82ef13..9804580 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -453,7 +453,7 @@ class Formatter // Formatting HTML. if ($this->options['type'] === 'html') { - return '<span ' . $format['html'] . '>' . $text . '</span>'; + return '<span ' . $format['html'] . '>' . htmlspecialchars($text, ENT_NOQUOTES) . '</span>'; } elseif ($this->options['type'] === 'cli') { return $format['cli'] . $text; } @@ -464,8 +464,9 @@ class Formatter if ($this->options['type'] === 'cli') { return "\x1b[39m" . $text; + } elseif ($this->options['type'] === 'html') { + return htmlspecialchars($text, ENT_NOQUOTES); } - return $text; } /** |