fix PHP 8.0 error forwarding mail as attachment (calling count on null)

This commit is contained in:
Ralf Becker 2021-10-14 09:39:01 +02:00
parent e36ad76b80
commit 60536222ce
2 changed files with 3 additions and 1 deletions

View File

@ -118,6 +118,8 @@ function egw_exception_handler($e)
$message = '<h3>'.Api\Html::htmlspecialchars($headline)."</h3>\n". $message = '<h3>'.Api\Html::htmlspecialchars($headline)."</h3>\n".
'<pre><b>'.Api\Html::htmlspecialchars($e->getMessage())."</b>\n\n"; '<pre><b>'.Api\Html::htmlspecialchars($e->getMessage())."</b>\n\n";
echo $e->getFile().' ('.$e->getLine().")\n";
// only show trace (incl. function arguments) if explicitly enabled, eg. on a development system // only show trace (incl. function arguments) if explicitly enabled, eg. on a development system
if ($GLOBALS['egw_info']['server']['exception_show_trace']) if ($GLOBALS['egw_info']['server']['exception_show_trace'])
{ {

View File

@ -2022,7 +2022,7 @@ class mail_compose
'size' => $_size, 'size' => $_size,
'folder' => $_folder, 'folder' => $_folder,
'winmailFlag' => $_is_winmail, 'winmailFlag' => $_is_winmail,
'tmp_name' => mail_ui::generateRowID($this->mail_bo->profileID, $_folder, $_uid).'_'.(!empty($_partID)?$_partID:count($this->sessionData['attachments'])+1), 'tmp_name' => mail_ui::generateRowID($this->mail_bo->profileID, $_folder, $_uid).'_'.(!empty($_partID)?$_partID:count($this->sessionData['attachments'] ?? [])+1),
); );
} }