fix PHP 8.0 TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given

This commit is contained in:
Ralf Becker 2021-11-15 14:53:35 +01:00
parent 3dd7af4aa5
commit b84136cff8

View File

@ -888,9 +888,9 @@ class calendar_merge extends Api\Storage\Merge
*/
protected function normalize_event_id($id)
{
if(is_string($id) || is_array($id) && $id['id'] && !$id['start'])
if(is_string($id) || is_array($id) && !empty($id['id']) && empty($id['start']))
{
if(strpos($id, ':'))
if (is_string($id) && strpos($id, ':'))
{
$_id = $id;
$id = array();