Project

General

Profile

Bug #21267 » 12230_trunk.diff

Administrator Admin, 2011-01-31 12:06

View differences:

typo3_src_trunk.new/typo3/sysext/cms/tslib/class.tslib_content.php 2011-01-31 13:45:54.000000000 +0300
$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)) {
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 = $afterstring . substr($content, $trunc_at);
} else {
$content = $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 = substr($content, 0, $trunc_at) . $afterstring;
} else {
$content = $content . $afterstring;
}
}
}
}
(1-1/4)