[TYPO3-core] RFC: #3527: Bug: Wrongly encoded characters in mail form validation popup

Martin Kutschker masi-no at spam-typo3.org
Fri Mar 27 15:24:15 CET 2009


Francois Suter schrieb:
> This is an SVN patch request.
> 
> Type: Bugfix
> 
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=3527
> 
> Branches:
> 4.2 and trunk
> 
> Problem:
> When a problem happens in the mail form a JS alert box pops up. If the
> field names contain non-latin-1 characters they are badly interpreted.
> 
> Solution:
> Call decodeURI() on the field name (to balance the rawurlencode() call
> in tslib_content).

-1 as this cannot work correctly unless the character set is utf8 as
decodeURI() expects utf8 while unescape() expects latin1. If you use
decodeURI() you must convert the data to utf8 on the server side before
using rawurlencode().

But... I think we don't need any escaping for strings *within* JS. The
escaping is only needed when passing values via URLs.

The whole escaping stuff in the FE libs and the odd JS string handling
in the BE are remnants of the bad old days when character set handling
in JS was broken.

Masi


More information about the TYPO3-team-core mailing list