From: Martin Kutschker Date: Fri, 30 Jun 2006 14:06:35 +0000 (+0000) Subject: t3lib_htmlmail: auto-detect charset (using FE or BE settings) with manual override X-Git-Tag: TYPO3_4-1-0RC1~288 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/358caa6000a6a9b3a942a4c5bffe9e133e2b7695 t3lib_htmlmail: auto-detect charset (using FE or BE settings) with manual override git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1578 709f56b5-9817-0410-a4d7-c38de5d9e867 --- diff --git a/ChangeLog b/ChangeLog index b3747f64418..b23d30e71d8 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ + +2006-06-30 Martin Kutschker + + * t3lib_htmlmail: auto-detect charset (using FE or BE settings) with manual override + 2006-06-30 Karsten Dambekalns * t3lib_page: Changed getMultipleGroupsWhereClause() to include a check using IS NULL to make it compatible to Oracle. Made enableFields() call getMultipleGroupsWhereClause() non-statically using $this. diff --git a/t3lib/class.t3lib_htmlmail.php b/t3lib/class.t3lib_htmlmail.php index 93612d26a42..8a9f6870333 100755 --- a/t3lib/class.t3lib_htmlmail.php +++ b/t3lib/class.t3lib_htmlmail.php @@ -274,26 +274,30 @@ class t3lib_htmlmail { $host = ($TYPO3_CONF_VARS['SYS']['sitename'] ? preg_replace('/[^A-Za-z0-9_\-]/', '_', $TYPO3_CONF_VARS['SYS']['sitename']) : 'localhost') . '.TYPO3'; } $this->messageid = md5(microtime()) . '@' . $host; - + // Default line break for Unix systems. $this->linebreak = chr(10); // Line break for Windows. This is needed because PHP on Windows systems send mails via SMTP instead of using sendmail, and thus the linebreak needs to be \r\n. if (TYPO3_OS=='WIN') { $this->linebreak = chr(13).chr(10); } - - $charset = $this->defaultCharset; - if (is_object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->config['metaCharset']) { - $charset = $GLOBALS['TSFE']->config['metaCharset']; - } elseif ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) { - $charset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']; + + if (!$this->charset) { + if (is_object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->renderCharset) { + $this->charset = $GLOBALS['TSFE']->renderCharset; + } elseif (is_object($GLOBALS['LANG']) && $GLOBALS['LANG']->charSet) { + $this->charset = $GLOBALS['LANG']->charSet; + } elseif ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) { + $this->charset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']; + } else { + $this->charset = $this->defaultCharset; + } } - $this->charset = $charset; - + // Use quoted-printable headers by default $this->useQuotedPrintable(); } - + /** * [Describe function...] *