do NOT give a 500 with "Error storing ...", for empty content/body

This commit is contained in:
ralf 2024-04-11 11:52:51 +02:00
parent 4c58132b53
commit db7fd298a1
1 changed files with 3 additions and 3 deletions

View File

@ -365,11 +365,11 @@ class ApiHandler extends Api\CalDAV\Handler
// save posted eml to a temp-dir
$eml = tempnam($GLOBALS['egw_info']['server']['temp_dir'], 'view-eml-');
if (!(is_resource($content) ?
if ((is_resource($content) ?
stream_copy_to_stream($content, $fp = fopen($eml, 'w')) :
file_put_contents($eml, $content)))
file_put_contents($eml, $content)) === false)
{
throw new \Exception('Error storing attachment');
throw new \Exception('Error storing eml file');
}
if (isset($fp)) fclose($fp);