Feature #21525 ยป tstemplate_charset.diff
t3lib/class.t3lib_tstemplate.php (working copy) | ||
---|---|---|
$hash = md5(serialize($cc));
|
||
// This stores the data.
|
||
t3lib_pageSelect::storeHash($hash, serialize($this->setup), 'TS_TEMPLATE');
|
||
$serializedSetup = serialize($this->setup);
|
||
t3lib_pageSelect::storeHash($hash, $serializedSetup, 'TS_TEMPLATE');
|
||
$checkSetup = t3lib_pageSelect::getHash($hash);
|
||
if (strcmp($checkSetup, $serializedSetup)) {
|
||
$message = 'Error while caching TypoScript template!<br />Check charset of included TypoScript files!';
|
||
if ($GLOBALS['TSFE']->checkPageUnavailableHandler()) {
|
||
$GLOBALS['TSFE']->pageUnavailableAndExit($message);
|
||
} else {
|
||
header('HTTP/1.0 503 Service Temporarily Unavailable');
|
||
t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
|
||
$GLOBALS['TSFE']->printError($message);
|
||
exit;
|
||
}
|
||
}
|
||
unset($checkSetup);
|
||
if ($this->tt_track) $GLOBALS['TT']->setTSlogMessage('TS template size, serialized: '.strlen(serialize($this->setup)).' bytes');
|
||
if ($this->tt_track) $GLOBALS['TT']->setTSlogMessage('TS template size, serialized: '.strlen($serializedSetup).' bytes');
|
||
unset($serializedSetup);
|
||
$rowSumHash = md5('ROWSUM:'.serialize($this->rowSum));
|
||
t3lib_pageSelect::storeHash($rowSumHash, serialize($cc['all']), 'TMPL_CONDITIONS_ALL');
|
t3lib/class.t3lib_tsparser.php (working copy) | ||
---|---|---|
$filename = t3lib_div::getFileAbsFileName(trim($sourceParts[1]));
|
||
if (strcmp($filename,'')) { // Must exist and must not contain '..' and must be relative
|
||
if (@is_file($filename) && filesize($filename)<100000) { // Max. 100 KB include files!
|
||
// check for includes in included text
|
||
$includedFiles[] = $filename;
|
||
$included_text = self::checkIncludeLines(t3lib_div::getUrl($filename),$cycle_counter+1, $returnFiles);
|
||
$fileContent = t3lib_div::getUrl($filename);
|
||
if ($charset = $params['charset']) {
|
||
$targetCharset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : $GLOBALS['TSFE']->defaultCharSet;
|
||
$fileContent = $GLOBALS['TSFE']->csConvObj->conv($fileContent, $GLOBALS['TSFE']->csConvObj->parse_charset($charset), $targetCharset, 1);
|
||
}
|
||
// check for includes in included text. Recursive call
|
||
$included_text = self::checkIncludeLines($fileContent, $cycle_counter+1, $returnFiles);
|
||
// If the method also has to return all included files, merge currently included
|
||
// files with files included by recursively calling itself
|
||
if ($returnFiles && is_array($included_text)) {
|