Commit a171f7c9 authored by Wouter Wolters's avatar Wouter Wolters Committed by Georg Ringer
Browse files

[BUGFIX] Only clear cache if you have access to the page

Resolves: #76786
Releases: master
Change-Id: I601bcdc46a9d7c569152857880445bcd8e510c1b
Reviewed-on: https://review.typo3.org/48670

Tested-by: default avatarBamboo TYPO3com <info@typo3.com>
Reviewed-by: Jigal van Hemert's avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert's avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 8fa774e0
......@@ -479,10 +479,10 @@ class PageLayoutController
*/
public function clearCache()
{
if ($this->clear_cache) {
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->start(array(), array());
$tce->clear_cacheCmd($this->id);
if ($this->clear_cache && !empty($this->pageinfo)) {
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
$dataHandler->start(array(), array());
$dataHandler->clear_cacheCmd($this->id);
}
}
......
......@@ -165,9 +165,14 @@ class ExtdirectTreeCommands
public static function clearCacheOfPage($nodeData)
{
$node = GeneralUtility::makeInstance(PagetreeNode::class, (array)$nodeData);
$tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$tce->start(array(), array());
$tce->clear_cacheCmd($node->getId());
$permissionClause = static::getBackendUser()->getPagePermsClause(1);
$access = BackendUtility::readPageAccess($node->getId(), $permissionClause);
if ($access) {
$dataHandler = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$dataHandler->start(array(), array());
$dataHandler->clear_cacheCmd($node->getId());
}
}
/**
......
Supports Markdown
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