fix regular expression stopping Mail REST API when trying to send mails

This commit is contained in:
ralf 2024-02-08 13:39:56 +02:00
parent 83a2729cf0
commit dc375f8e02

View File

@ -1530,7 +1530,7 @@ class CalDAV extends HTTP_WebDAV_Server
// POST to the collection URL plus a UID like name component (like for regular PUT) to create new entrys
if (isset($_GET['add-member']) || Handler::get_agent() == 'cfnetwork' ||
// REST API: all but mail have no POST handler, therefore we have to call the PUT handler
!preg_match('#^(/[^/]+)?/mail/$#', $options['path']) && self::isJSON())
!preg_match('#^(/[^/]+)?/mail(/|$)#', $options['path']) && self::isJSON())
{
$_GET['add-member'] = ''; // otherwise we give no Location header
return $this->PUT($options, 'POST');