Changeset 578 for trunk/lib


Ignore:
Timestamp:
Feb 27, 2017 2:20:50 PM (7 years ago)
Author:
anonymous
Message:

Convert email template to UTF-8 if necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Email.inc.php

    r559 r578  
    181181            return false;
    182182        }
     183
     184        // Ensure template is UTF-8.
     185        $detected_encoding = mb_detect_encoding($this->_template, array('UTF-8', 'ISO-8859-1', 'WINDOWS-1252'), true);
     186        if ('UTF-8' != strtoupper($detected_encoding)) {
     187            $this->_template = mb_convert_encoding($this->_template, 'UTF-8', $detected_encoding);
     188        }
     189
    183190        // This could be a new template, so reset the _template_replaced.
    184191        $this->_template_replaced = null;
Note: See TracChangeset for help on using the changeset viewer.