mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
sanitize name
This commit is contained in:
@@ -178,7 +178,9 @@ class MassUpdate implements MassAction
|
||||
|
||||
private function clearRoleCache(string $id): void
|
||||
{
|
||||
$this->fileManager->removeFile('data/cache/application/acl/' . $id . '.php');
|
||||
$part = basename($id);
|
||||
|
||||
$this->fileManager->removeFile("data/cache/application/acl/$part.php");
|
||||
}
|
||||
|
||||
private function clearPortalRolesCache(): void
|
||||
|
||||
@@ -63,7 +63,7 @@ class Clearer
|
||||
return;
|
||||
}
|
||||
|
||||
$part = $user->getId() . '.php';
|
||||
$part = basename($user->getId() . '.php');
|
||||
|
||||
$this->fileManager->remove('data/cache/application/acl/' . $part);
|
||||
$this->fileManager->remove('data/cache/application/aclMap/' . $part);
|
||||
@@ -77,7 +77,7 @@ class Clearer
|
||||
->find();
|
||||
|
||||
foreach ($portals as $portal) {
|
||||
$part = $portal->getId() . '/' . $user->getId() . '.php';
|
||||
$part = basename($portal->getId()) . '/' . basename($user->getId() . '.php');
|
||||
|
||||
$this->fileManager->remove('data/cache/application/aclPortal/' . $part);
|
||||
$this->fileManager->remove('data/cache/application/aclPortalMap/' . $part);
|
||||
|
||||
@@ -115,7 +115,8 @@ class EspoUploadDir implements Storage, Local
|
||||
protected function getFilePath(Attachment $attachment)
|
||||
{
|
||||
$sourceId = $attachment->getSourceId();
|
||||
$file = basename($sourceId);
|
||||
|
||||
return 'data/upload/' . $sourceId;
|
||||
return 'data/upload/' . $file;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,9 @@ class Starter extends StarterBase
|
||||
SystemConfig $systemConfig,
|
||||
ApplicationState $applicationState
|
||||
) {
|
||||
$routeCacheFile = 'data/cache/application/slim-routes-portal-' . $applicationState->getPortalId() . '.php';
|
||||
$part = basename($applicationState->getPortalId());
|
||||
|
||||
$routeCacheFile = 'data/cache/application/slim-routes-portal-' . $part . '.php';
|
||||
|
||||
parent::__construct(
|
||||
$requestProcessor,
|
||||
|
||||
@@ -174,7 +174,9 @@ class Image implements EntryPoint
|
||||
|
||||
$sourceId = $attachment->getSourceId();
|
||||
|
||||
$cacheFilePath = "data/upload/thumbs/{$sourceId}_$size";
|
||||
$file = basename("{$sourceId}_$size");
|
||||
|
||||
$cacheFilePath = "data/upload/thumbs/$file";
|
||||
|
||||
if ($useCache && $this->fileManager->isFile($cacheFilePath)) {
|
||||
return $this->fileManager->getContents($cacheFilePath);
|
||||
|
||||
@@ -89,7 +89,9 @@ class RemoveFile implements AfterRemove
|
||||
$sizeList = array_keys($this->metadata->get(['app', 'image', 'sizes']) ?? []);
|
||||
|
||||
foreach ($sizeList as $size) {
|
||||
$filePath = "data/upload/thumbs/{$entity->getSourceId()}_{$size}";
|
||||
$file = basename("{$entity->getSourceId()}_$size");
|
||||
|
||||
$filePath = "data/upload/thumbs/$file";
|
||||
|
||||
if ($this->fileManager->isFile($filePath)) {
|
||||
$this->fileManager->removeFile($filePath);
|
||||
|
||||
Reference in New Issue
Block a user