Commit 5a3c8c75 authored by Christoph Hofmann's avatar Christoph Hofmann

update

parent 76835182
......@@ -727,8 +727,8 @@ class tx_realurl {
if (!isset($GLOBALS['TSFE']->applicationData['tx_realurl']['_CACHE'][$hash]) && $this->extConf['init']['enableUrlEncodeCache']) {
/** @noinspection PhpUndefinedMethodInspection */
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('content', 'tx_realurl_urlencodecache',
'url_hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'tx_realurl_urlencodecache') .
' AND tstamp>' . strtotime('midnight', time() - 24 * 3600 * $this->encodeCacheTTL));
'url_hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'tx_realurl_urlencodecache') .
' AND tstamp>' . strtotime('midnight', time() - 24 * 3600 * $this->encodeCacheTTL));
/** @noinspection PhpUndefinedMethodInspection */
if (false != ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
$GLOBALS['TSFE']->applicationData['tx_realurl']['_CACHE'][$hash] = $row['content'];
......@@ -744,19 +744,19 @@ class tx_realurl {
$GLOBALS['TSFE']->applicationData['tx_realurl']['_CACHE'][$hash] = $setEncodedURL;
// If the page id is NOT an integer, it's an alias we have to look up
if (!self::testInt($this->encodePageId)) {
if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->encodePageId)) {
$this->encodePageId = $this->pageAliasToID($this->encodePageId);
}
if ($this->extConf['init']['enableUrlEncodeCache'] && $this->canCachePageURL($this->encodePageId)) {
$insertFields = array(
'url_hash' => $hash,
'origparams' => $urlData,
'internalExtras' => count($internalExtras) ? serialize($internalExtras) : '',
'content' => $setEncodedURL,
'page_id' => $this->encodePageId,
'tstamp' => time()
);
'url_hash' => $hash,
'origparams' => $urlData,
'internalExtras' => count($internalExtras) ? serialize($internalExtras) : '',
'content' => $setEncodedURL,
'page_id' => $this->encodePageId,
'tstamp' => time()
);
if ($this->useMySQLExtendedSyntax) {
/** @noinspection PhpUndefinedMethodInspection */
$query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_realurl_urlencodecache', $insertFields);
......@@ -802,20 +802,18 @@ class tx_realurl {
if (isset($paramKeyValues['cHash'])) {
if ($this->rebuildCHash) {
$cacheHashClassExists = class_exists('t3lib_cacheHash');
$cacheHash = ($cacheHashClassExists ? t3lib_div::makeInstance('t3lib_cacheHash') : NULL);
/** @noinspection PhpUndefinedClassInspection */
/* @var t3lib_cacheHash $cacheHash */
$cacheHashClassExists = class_exists('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator');
$cacheHash = ($cacheHashClassExists ? \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator') : NULL);
/* @var \TYPO3\CMS\Frontend\Page\CacheHashCalculator $cacheHash */
$cHashParameters = array_merge($this->cHashParameters, $paramKeyValues);
unset($cHashParameters['cHash']);
$cHashParameters = t3lib_div::implodeArrayForUrl('', $cHashParameters);
$cHashParameters = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $cHashParameters);
if ($cacheHashClassExists) {
/** @noinspection PhpUndefinedMethodInspection */
$cHashParameters = $cacheHash->getRelevantParameters($cHashParameters);
} else {
/** @noinspection PhpUndefinedMethodInspection PhpDeprecationInspection */
$cHashParameters = t3lib_div::cHashParams($cHashParameters);
$cHashParameters = \TYPO3\CMS\Core\Utility\GeneralUtility::cHashParams($cHashParameters);
}
unset($cHashParameters['']);
if (count($cHashParameters) == 1) {
......@@ -824,14 +822,13 @@ class tx_realurl {
}
elseif (count($cHashParameters) > 1) {
if ($cacheHashClassExists) {
/** @noinspection PhpUndefinedMethodInspection */
$paramKeyValues['cHash'] = $cacheHash->calculateCacheHash($cHashParameters);
} elseif (method_exists('t3lib_div', 'calculateCHash')) {
} elseif (method_exists('\TYPO3\CMS\Core\Utility\GeneralUtility', 'calculateCHash')) {
/** @noinspection PhpUndefinedMethodInspection PhpDeprecationInspection */
$paramKeyValues['cHash'] = t3lib_div::calculateCHash($cHashParameters);
$paramKeyValues['cHash'] = \TYPO3\CMS\Core\Utility\GeneralUtility::calculateCHash($cHashParameters);
} else {
/** @noinspection PhpUndefinedMethodInspection PhpDeprecationInspection */
$paramKeyValues['cHash'] = t3lib_div::shortMD5(serialize($cHashParameters));
$paramKeyValues['cHash'] = \TYPO3\CMS\Core\Utility\GeneralUtility::shortMD5(serialize($cHashParameters));
}
}
unset($cHashParameters);
......
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