Project

General

Profile

Feature #68990 ยป constant_v0.1.diff

Nicolas Forgeot, 2015-08-12 15:20

View differences:

typo3/sysext/backend/Classes/Utility/BackendUtility.php
}
$whereClause = implode('', $whereClauseParts);
}
return str_replace (
array (
'###CURRENT_PID###',
'###THIS_UID###',
'###THIS_CID###',
'###STORAGE_PID###',
'###SITEROOT###',
'###PAGE_TSCONFIG_ID###',
'###PAGE_TSCONFIG_IDLIST###',
'###PAGE_TSCONFIG_STR###'
),
array(
(int)$tsConfig['_CURRENT_PID'],
(int)$tsConfig['_THIS_UID'],
(int)$tsConfig['_THIS_CID'],
(int)$tsConfig['_STORAGE_PID'],
(int)$tsConfig['_SITEROOT'],
(int)$tsConfig[$field]['PAGE_TSCONFIG_ID'],
$GLOBALS['TYPO3_DB']->cleanIntList($tsConfig[$field]['PAGE_TSCONFIG_IDLIST']),
$GLOBALS['TYPO3_DB']->quoteStr($tsConfig[$field]['PAGE_TSCONFIG_STR'], $table)
),
$whereClause
$specialMarker = array (
'###CURRENT_PID###',
'###THIS_UID###',
'###THIS_CID###',
'###STORAGE_PID###',
'###SITEROOT###',
'###PAGE_TSCONFIG_ID###',
'###PAGE_TSCONFIG_IDLIST###',
'###PAGE_TSCONFIG_STR###'
);
$specialMarkerValues = array (
(int)$tsConfig['_CURRENT_PID'],
(int)$tsConfig['_THIS_UID'],
(int)$tsConfig['_THIS_CID'],
(int)$tsConfig['_STORAGE_PID'],
(int)$tsConfig['_SITEROOT'],
(int)$tsConfig[$field]['PAGE_TSCONFIG_ID'],
$GLOBALS['TYPO3_DB']->cleanIntList($tsConfig[$field]['PAGE_TSCONFIG_IDLIST']),
$GLOBALS['TYPO3_DB']->quoteStr($tsConfig[$field]['PAGE_TSCONFIG_STR'], $table)
);
if($tsConfig[$field]) {
$customMarker = array();
foreach ($tsConfig[$field] as $marker => $value) {
if (preg_match('/^PAGE_TSCONFIG_CUSTOM_(ID|IDLIST|STR)_/', $marker, $matches)) {
$customMarker[$marker] = $matches[1];
}
}
foreach ($customMarker as $marker => $type) {
$specialMarker[] = '###' . $marker . '###';
switch ($type) {
case 'ID':
$specialMarkerValues[] = (int)$tsConfig[$field][$marker];
break;
case 'IDLIST':
$specialMarkerValues[] = $GLOBALS['TYPO3_DB']->cleanIntList($tsConfig[$field][$marker]);
break;
case 'STR':
$specialMarkerValues[] = $GLOBALS['TYPO3_DB']->quoteStr($tsConfig[$field][$marker], $table);
break;
}
}
}
return str_replace($specialMarker, $specialMarkerValues, $whereClause);
}
/**
    (1-1/1)