EmailTemplate::formatContent PHP Méthode

formatContent() protected méthode

Filters an unsafe HTML string and returns it.
protected formatContent ( string $html, boolean $convertNewlines = false, boolean $filter = false ) : string
$html string The HTML to filter.
$convertNewlines boolean Whether to convert new lines to html br tags.
$filter boolean Whether to escape HTML or not.
Résultat string The filtered HTML string.
    protected function formatContent($html, $convertNewlines = false, $filter = false)
    {
        $str = $html;
        if ($filter) {
            $str = Gdn_Format::htmlFilter($str);
        }
        if ($convertNewlines) {
            $str = preg_replace('/(\\015\\012)|(\\015)|(\\012)/', '<br>', $str);
        }
        // $str = strip_tags($str, ['b', 'i', 'p', 'strong', 'em', 'br']);
        return $str;
    }