Issue Bug Closed

#17301Wrong cropping of multi-byte $TCA field

John Angel 05/12/07, 13:04 updated 07/02/10, 11:19

Description

In function checkValue_input, class.t3lib_tcemain.php:1264

OLD CODE:

// Secures the string-length to be less than max. Will probably make problems with multi-byte strings!
if (intval($tcaFieldConf[‘max’])>0) {$value = substr($value,0,intval($tcaFieldConf[‘max’]));}

NEW CODE:

if (intval($tcaFieldConf[‘max’])>0)
{
global $LANG;
$value = $LANG->csConvObj->substr($LANG->charSet,$value,0,intval($tcaFieldConf[‘max’]));
}

(issue imported from #M5618)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.