[TYPO3-core] RFC: fix bug #3600 - config.formMailCharset

Michael Stucki michael at typo3.org
Sat Jul 1 14:57:53 CEST 2006


These lines are ok of course, no need for a function here!

Martin, there's one thing I've noticed:

+ $val = ($V['from_name']) ? $V['from_name'] : (($V['name'])?$V['name']:'');
+ $this->from_name = $convCharset ? $GLOBALS['TSFE']->csConvObj->conv($val,$GLOBALS['TSFE']->renderCharset,$this->charset) : $val;

It may happen that the conv() method is called using an empty string
(default value if "from_name" and "name" are both not set). I suggest to
extend the check on the next line accordingly (for all except "subject"):

- $this->from_name = $convCharset ? $GLOBALS['TSFE']->csConvObj->conv($val,$GLOBALS['TSFE']->renderCharset,$this->charset) : $val;
+ $this->from_name = $convCharset && strlen($val) ? $GLOBALS['TSFE']->csConvObj->conv($val,$GLOBALS['TSFE']->renderCharset,$this->charset) : $val;

1) Tested the patch in TYPO3_4-0
2) Can confirm that config.formMailCharset did not work before
3) Can confirm that the patch solves the issue

+1

Michael

Franz Holzinger wrote:

> Martin Kutschker a écrit :
> 
>>
>> Part 1:
>> Now that the t3lib_htmlmail charset fix is in it is possible to set
>> the charset of the mail. This is done by calling the parent's start()
>> and then checking for config.formMailCharset.
>>
>> Part 2:
>> To make the setting really work it is necessary to convert the charset
>> from the form into the desired mail charset. The patch does this. Note
>> that renderCharset is used because TYPO3 (see index_ts) does
>> automatically convert the sent data (metaCharset) into the internal
>> charset (renderCharset).
>>
> 
>> $this->organisation = $convCharset ?
>> $GLOBALS['TSFE']->csConvObj->conv($val,$GLOBALS['TSFE']->renderCharset,$this->charset)
>> : $val;
> 
> You have identical code 4 times here and they are rather long lines.
> Please make a function out of it.
> 
> 
> - Franz

-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/



More information about the TYPO3-team-core mailing list