[TYPO3-core] RFC: #12863: t3lib_cs::convArray converts integers to string

Steffen Kamper info at sk-typo3.de
Tue Dec 1 00:49:38 CET 2009


Hi,

This is an SVN patch request.

Type: bugfix

BT reference: http://bugs.typo3.org/view.php?id=12863

Branches: trunk, 4_3

As the conversion is used for javascript arrays that may contain also 
integers/booleans the conversion should only convert strings.

If integer is converted to string the JS code may be broken if strict 
comparisons are used in scripts.

The problem can be seen with applying following patch:
Index: typo3/backend.php
===================================================================
--- typo3/backend.php	(revision 6606)
+++ typo3/backend.php	(working copy)
@@ -415,7 +415,7 @@

  			// Convert labels/settings back to UTF-8 since json_encode() only 
works with UTF-8:
  		if ($GLOBALS['LANG']->charSet !== 'utf-8') {
-			$t3Configuration['username'] = 
$GLOBALS['LANG']->csConvObj->conv($t3Configuration['username'], 
$GLOBALS['LANG']->charSet, 'utf-8');
+			$GLOBALS['LANG']->csConvObj->convArray($t3Configuration, 
$GLOBALS['LANG']->charSet, 'utf-8');
  			$GLOBALS['LANG']->csConvObj->convArray($t3LLLcore, 
$GLOBALS['LANG']->charSet, 'utf-8');
  			$GLOBALS['LANG']->csConvObj->convArray($t3LLLfileUpload, 
$GLOBALS['LANG']->charSet, 'utf-8');
  		}

As result you'll see in TYPO3.configuration eg this:
"condensedMode":"0"

which breaks all modules with page tree.

Remark: With using non-utf8 BE all labels/settings in pageRenderer 
(inlineLanguageLabels/inlineSettings) are converted with 
t3lib_ts::convArray to utf8 for a correct output in FE.

vg Steffen
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 12863.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20091201/581af3a1/attachment.txt>


More information about the TYPO3-team-core mailing list