Skip to content

Commit

Permalink
convert $title and $th special characters to HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago Brito committed Nov 20, 2013
1 parent b230483 commit e98c525
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Monolog/Formatter/HtmlEmailFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function __construct($dateFormat = null)
*/
private function addRow($th, $td = ' ')
{
$th = htmlspecialchars($th);
$td = '<pre>'.htmlspecialchars($td).'</pre>';

return "<tr style=\"padding: 4px;spacing: 0;text-align: left;\">\n<th style=\"background: #cccccc\" width=\"100px\">$th:</th>\n<td style=\"padding: 4px;spacing: 0;text-align: left;background: #eeeeee\">".$td."</td>\n</tr>";
Expand All @@ -64,6 +65,8 @@ private function addRow($th, $td = ' ')
*/
private function addTitle($title, $level)
{
$title = htmlspecialchars($title);

return '<h1 style="background: '.$this->logLevels[$level].';color: #ffffff;padding: 5px;">'.$title.'</h1>';
}
/**
Expand Down

0 comments on commit e98c525

Please sign in to comment.