diff -ru typo3_src_trunk.orig/typo3/sysext/cms/tslib/class.tslib_content.php typo3_src_trunk.new/typo3/sysext/cms/tslib/class.tslib_content.php --- typo3_src_trunk.orig/typo3/sysext/cms/tslib/class.tslib_content.php 2011-01-31 08:12:43.000000000 +0300 +++ typo3_src_trunk.new/typo3/sysext/cms/tslib/class.tslib_content.php 2011-01-31 21:50:44.000000000 +0300 @@ -3593,15 +3593,20 @@ $afterstring = trim($options[1]); $crop2space = trim($options[2]); if ($chars) { - if (strlen($content) > abs($chars)) { + if ($GLOBALS['TSFE']->csConvObj->strlen($GLOBALS['TSFE']->renderCharset, $content) > abs($chars)) { + $trunc_at = FALSE; if ($chars < 0) { $content = $GLOBALS['TSFE']->csConvObj->substr($GLOBALS['TSFE']->renderCharset, $content, $chars); - $trunc_at = strpos($content, ' '); - $content = ($trunc_at && $crop2space) ? $afterstring . substr($content, $trunc_at) : $afterstring . $content; + if ($crop2space) { + $trunc_at = strpos($content, ' '); + } + $content = ($trunc_at) ? $afterstring . substr($content, $trunc_at) : $afterstring . $content; } else { $content = $GLOBALS['TSFE']->csConvObj->substr($GLOBALS['TSFE']->renderCharset, $content, 0, $chars); - $trunc_at = strrpos($content, ' '); - $content = ($trunc_at && $crop2space) ? substr($content, 0, $trunc_at) . $afterstring : $content . $afterstring; + if ($crop2space) { + $trunc_at = strrpos($content, ' '); + } + $content = ($trunc_at) ? substr($content, 0, $trunc_at) . $afterstring : $content . $afterstring; } } }