Project

General

Profile

Bug #25368 ยป 18003.diff

Administrator Admin, 2011-03-25 13:42

View differences:

typo3/sysext/cms/tslib/class.tslib_content.php
$cropPosition = $absChars - $strLen;
// The snippet "&[^&\s;]{2,8};" in the RegEx below represents entities.
$patternMatchEntityAsSingleChar = '(&[^&\s;]{2,8};|.)';
if ($crop2space) {
$cropRegEx = $chars < 0
? '#(?<=\s)' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}$#ui'
: '#^' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}(?=\s)#ui';
} else {
$cropRegEx = $chars < 0
? '#' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}$#ui'
: '#^' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}#ui';
}
$cropRegEx = $chars < 0
? '#' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}$#ui'
: '#^' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}#ui';
if (preg_match($cropRegEx, $tempContent, $croppedMatch)) {
$tempContent = $croppedMatch[0];
if ($crop2space) {
$cropRegEx = $chars < 0
? '#(?<=\s)' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}$#ui'
: '#^' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}(?=\s)#ui';
if (preg_match($cropRegEx, $tempContent, $croppedMatch)) {
$tempContent = $croppedMatch[0];
}
}
}
$splittedContent[$offset] = $GLOBALS['TSFE']->csConvObj->utf8_decode($tempContent, $GLOBALS['TSFE']->renderCharset);
break;
    (1-1/1)