global restriction fix

This commit is contained in:
yuri
2019-08-05 14:05:04 +03:00
parent b7e9e69f35
commit b399c4444d
+11 -1
View File
@@ -68,9 +68,17 @@ class GlobalRestricton
$this->fileManager = $fileManager;
$this->fieldManagerUtil = $fieldManagerUtil;
$isFromCache = false;
if ($useCache) {
if (file_exists($this->cacheFilePath)) {
$this->data = include($this->cacheFilePath);
$isFromCache = true;
if (!($this->data instanceof \StdClass)) {
$GLOBALS['log']->error("ACL GlobalRestricton: Bad data fetched from cache.");
$this->data = null;
}
}
}
@@ -79,7 +87,9 @@ class GlobalRestricton
}
if ($useCache) {
$this->storeCacheFile();
if (!$isFromCache) {
$this->storeCacheFile();
}
}
}