mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:29 +01:00
do NOT give a 500 with "Error storing ...", for empty content/body
This commit is contained in:
parent
4c58132b53
commit
db7fd298a1
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user