Commit dec0be49 authored by Christoph Hofmann's avatar Christoph Hofmann

update

parent 5a3c8c75
......@@ -931,7 +931,7 @@ class tx_realurl {
'params' => $params,
'URL' => &$speakingURIpath,
);
TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($userFunc, $hookParams, $this);
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($userFunc, $hookParams, $this);
}
}
......@@ -942,7 +942,7 @@ class tx_realurl {
$speakingURIpath = substr($speakingURIpath, 0, -1);
}
if (preg_match($regexp, $speakingURIpath)) { // Only process if a slash is missing:
$options = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->extConf['init']['appendMissingSlash'], true);
$options = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->extConf['init']['appendMissingSlash'], true);
if (in_array('ifNotFile', $options)) {
if (!preg_match('/\/[^\/\?]+\.[^\/]+(\?.*)?$/', '/' . $speakingURIpath)) {
$speakingURIpath = preg_replace($regexp, '\1/\2', $speakingURIpath);
......@@ -965,7 +965,7 @@ class tx_realurl {
if (!@parse_url($speakingURIpath, PHP_URL_HOST)) {
@ob_end_clean();
header($status);
header('Location: ' . TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($speakingURIpath));
header('Location: ' . \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($speakingURIpath));
exit;
}
}
......@@ -975,8 +975,8 @@ class tx_realurl {
}
// If the URL is a single script like "123.1.html" it might be an "old" simulateStaticDocument request. If this is the case and support for this is configured, do NOT try and resolve it as a Speaking URL
$fI = TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($speakingURIpath);
if (!self::testInt($this->pObj->id) && $fI['path'] == '' && $this->extConf['fileName']['defaultToHTMLsuffixOnPrev'] && $this->extConf['init']['respectSimulateStaticURLs']) {
$fI = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($speakingURIpath);
if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->pObj->id) && $fI['path'] == '' && $this->extConf['fileName']['defaultToHTMLsuffixOnPrev'] && $this->extConf['init']['respectSimulateStaticURLs']) {
// If page ID does not exist yet and page is on the root level and both
// respectSimulateStaticURLs and defaultToHTMLsuffixOnPrev are set, than
// ignore respectSimulateStaticURLs and attempt to resolve page id.
......@@ -1142,11 +1142,11 @@ class tx_realurl {
$pre_GET_VARS = $this->decodeSpURL_settingPreVars($pathParts, $this->extConf['preVars']);
if (isset($this->extConf['pagePath']['languageGetVar'])) {
$languageGetVar = $this->extConf['pagePath']['languageGetVar'];
if (isset($pre_GET_VARS[$languageGetVar]) && self::testInt($pre_GET_VARS[$languageGetVar])) {
if (isset($pre_GET_VARS[$languageGetVar]) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($pre_GET_VARS[$languageGetVar])) {
// Language from URL
$this->detectedLanguage = $pre_GET_VARS[$languageGetVar];
}
elseif (isset($_GET[$languageGetVar]) && self::testInt($_GET[$languageGetVar])) {
elseif (isset($_GET[$languageGetVar]) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($_GET[$languageGetVar])) {
// This is for _DOMAINS feature
$this->detectedLanguage = $_GET[$languageGetVar];
}
......@@ -1168,37 +1168,31 @@ class tx_realurl {
$this->decodeSpURL_throw404('"' . $speakingURIpath . '" could not be found, closest page matching is ' . substr(implode('/', $this->dirParts), 0, -strlen(implode('/', $pathParts))) . '');
}
// Merge GET vars together
// Merge Get vars together
$cachedInfo['GET_VARS'] = array();
if (is_array($pre_GET_VARS)) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $pre_GET_VARS);
}
if (is_array($id_GET_VARS)) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $id_GET_VARS);
}
if (is_array($fixedPost_GET_VARS)) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $fixedPost_GET_VARS);
}
if (is_array($post_GET_VARS)) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $post_GET_VARS);
}
if (is_array($file_GET_VARS) ) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $file_GET_VARS);
}
if (is_array($pre_GET_VARS))
ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $pre_GET_VARS);
if (is_array($id_GET_VARS))
ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $id_GET_VARS);
if (is_array($fixedPost_GET_VARS))
ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $fixedPost_GET_VARS);
if (is_array($post_GET_VARS))
ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $post_GET_VARS);
if (is_array($file_GET_VARS))
ArrayUtility::mergeRecursiveWithOverrule($cachedInfo['GET_VARS'], $file_GET_VARS);
// cHash handling
if ($cHashCache) {
if ($cachedInfo['GET_VARS']) {
$queryString = TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $cachedInfo['GET_VARS']);
$queryString = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $cachedInfo['GET_VARS']);
$cacheHashClassExists = class_exists('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator');
if ($cacheHashClassExists) {
$cacheHash = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator');
/** @var \TYPO3\CMS\Frontend\Page\CacheHashCalculator $cacheHash */
$containsRelevantParametersForCHashCreation = count($cacheHash->getRelevantParameters(ltrim($queryString, '&'))) > 0;
} else {
/** @noinspection PhpUndefinedMethodInspection PhpDeprecationInspection */
//$containsRelevantParametersForCHashCreation = count(t3lib_div::cHashParams($queryString)) > 0;
$containsRelevantParametersForCHashCreation = \TYPO3\CMS\Frontend\Page\CacheHashCalculator::doParametersRequireCacheHash($queryString);
$containsRelevantParametersForCHashCreation = count(\TYPO3\CMS\Core\Utility\GeneralUtility::cHashParams($queryString)) > 0;
}
if ($containsRelevantParametersForCHashCreation) {
$cHash_value = $this->decodeSpURL_cHashCache($speakingURIpath);
......@@ -1206,7 +1200,7 @@ class tx_realurl {
$cachedInfo['GET_VARS']['cHash'] = $cHash_value;
}
}
}}
}
// Return information found
return $cachedInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment