mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 08:27:03 +03:00
There is no $oConfig, guessing it's Api::Config() here
This commit is contained in:
parent
4bbe93aea7
commit
a41aac28d3
1 changed files with 2 additions and 2 deletions
|
|
@ -156,14 +156,14 @@ class Utils
|
||||||
public static function saveFile(string $filename, string $data) : void
|
public static function saveFile(string $filename, string $data) : void
|
||||||
{
|
{
|
||||||
$dir = \dirname($filename);
|
$dir = \dirname($filename);
|
||||||
if (!\is_dir($dir) && !\mkdir($dir, intval($oConfig->Get('security', 'dir_permissions')), true)) {
|
if (!\is_dir($dir) && !\mkdir($dir, intval(Api::Config()->Get('security', 'dir_permissions')), true)) {
|
||||||
throw new \RuntimeException('Failed to create directory "'.$dir.'"');
|
throw new \RuntimeException('Failed to create directory "'.$dir.'"');
|
||||||
}
|
}
|
||||||
if (false === \file_put_contents($filename, $data)) {
|
if (false === \file_put_contents($filename, $data)) {
|
||||||
throw new \RuntimeException('Failed to save file "'.$filename.'"');
|
throw new \RuntimeException('Failed to save file "'.$filename.'"');
|
||||||
}
|
}
|
||||||
\clearstatcache();
|
\clearstatcache();
|
||||||
\chmod($filename, intval($oConfig->Get('security', 'file_permissions')));
|
\chmod($filename, intval(Api::Config()->Get('security', 'file_permissions')));
|
||||||
/*
|
/*
|
||||||
try {
|
try {
|
||||||
} catch (\Throwable $oException) {
|
} catch (\Throwable $oException) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue