Project

General

Profile

Bug #22178 » patch_13649_2.diff

Administrator Admin, 2010-06-25 13:45

View differences:

typo3/sysext/cms/tslib/class.tslib_pagegen.php (working copy)
$GLOBALS['TSFE']->sWordRegEx='';
$GLOBALS['TSFE']->sWordList = t3lib_div::_GP('sword_list');
if (is_array($GLOBALS['TSFE']->sWordList)) {
$standAlone = trim(''.$GLOBALS['TSFE']->config['config']['sword_standAlone']);
$noMixedCase = trim(''.$GLOBALS['TSFE']->config['config']['sword_noMixedCase']);
$space = (!empty($GLOBALS['TSFE']->config['config']['sword_standAlone'])) ? '[[:space:]]' : '';
$space = ($standAlone) ? '[[:space:]]' : '';
foreach ($GLOBALS['TSFE']->sWordList as $val) {
if (trim($val)) {
if (!$noMixedCase) {
$GLOBALS['TSFE']->sWordRegEx.= $space.sql_regcase(quotemeta($val)).$space.'|';
} else {
if (strlen(trim($val)) > 0) {
$GLOBALS['TSFE']->sWordRegEx.= $space.quotemeta($val).$space.'|';
}
}
}
$GLOBALS['TSFE']->sWordRegEx = preg_replace('/\|$/','',$GLOBALS['TSFE']->sWordRegEx);
typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
if ($GLOBALS['TSFE']->no_cache && $conf['sword'] && is_array($GLOBALS['TSFE']->sWordList) && $GLOBALS['TSFE']->sWordRegEx) {
$newstring = '';
do {
$pieces = preg_split('/' . $GLOBALS['TSFE']->sWordRegEx . '/', $data, 2);
$pregSplitMode = 'i';
if (isset($GLOBALS['TSFE']->config['config']['sword_noMixedCase']) && !empty($GLOBALS['TSFE']->config['config']['sword_noMixedCase'])) {
$pregSplitMode = '';
}
$pieces = preg_split('/' . $GLOBALS['TSFE']->sWordRegEx . '/'.$pregSplitMode, $data, 2);
$newstring.=$pieces[0];
$match_len = strlen($data)-(strlen($pieces[0])+strlen($pieces[1]));
if (strstr($pieces[0],'<') || strstr($pieces[0],'>')) {
(2-2/2)