[TYPO3-core] RFC: Fix bug #6121: formmail: reply-to can contain invalid characters if formMailCharset different from site charset

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Tue Oct 16 17:52:56 CEST 2007


Michael Stucki schrieb:
> This is an SVN patch request.
> 
> Type: Bugfix
> 
> Problem:
> formmail automatically converts character sets in mail headers if you define 
> config['formMailCharset'] different than your site charset.
> In case your form didn't set the reply-to header explicitely, a copy of the 
> from header is used.
> Unfortunately reply-to is set to a copy of the already converted from header 
> and then again run through the conversion routine, which leads to invalid 
> characters in the resulting string.
> 
> Solution:
> Copy $val again instead of using already encoded value $this->name. Simple but 
> efficient...

Ok, but I suggest to use a different tmp. variable then $val. $val ist 
reused all the time and anyone tyring to move the replyto_name code around 
will break things.

eg.

$val = ($V['from_name']) ? $V['from_name'] : (($V['name'])?$V['name']:'');
$raw_frome_name = $val; // stored for reuse in replyto_name
...
$val = ($V['replyto_name']) ? $V['replyto_name'] : $raw_frome_name;

Apart from that +1 from reading (also for the nont described second fix: >= 
instead of >).

Masi


More information about the TYPO3-team-core mailing list