Project

General

Profile

Bug #22357 » 0013972_4.4-rev7223.patch

Administrator Admin, 2010-03-30 20:38

View differences:

typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
$croppedOffset = $offset;
$cropPosition = $absChars - $strLen;
if ($crop2space) {
$cropRegEx = $chars < 0 ? '#(?<=\s)(.(?![^&\s]{2,7};)|(&[^&\s;]{2,7};)){0,' . $cropPosition . '}$#ui' : '#^(.(?![^&\s]{2,7};)|(&[^&\s;]{2,7};)){0,' . $cropPosition . '}(?=\s)#ui';
$cropRegEx = $chars < 0 ?
'#(?<=\s)([.(?!&[^&\s;]{2,7};)]|[(&[^&\s;]{2,7};)]){0,' . $cropPosition . '}$#ui' :
'#^([.(?!&[^&\s;]{2,7};)]|[(&[^&\s;]{2,7};)]){0,' . $cropPosition . '}(?=\s)#ui';
} else {
// The snippets "&[^&\s;]{2,7};" in the RegEx below represents entities.
$cropRegEx = $chars < 0 ? '#(.(?![^&\s]{2,7};)|(&[^&\s;]{2,7};)){0,' . $cropPosition . '}$#ui' : '#^(.(?![^&\s]{2,7};)|(&[^&\s;]{2,7};)){0,' . $cropPosition . '}#ui';
$cropRegEx = $chars < 0 ?
'#([.(?!&[^&\s;]{2,7};)]|[(&[^&\s;]{2,7};)]){0,' . $cropPosition . '}$#ui' :
'#^([.(?!&[^&\s;]{2,7};)]|[(&[^&\s;]{2,7};)]){0,' . $cropPosition . '}#ui';
}
if (preg_match($cropRegEx, $tempContent, $croppedMatch)) {
$tempContent = $croppedMatch[0];
(1-1/4)