CalDAVRequest: make content-type match non-greedy

this fixes a warning when the client doesn't include a space between
content-type and charset:

LOG: WARNING:Application sent content-type of "text/vcard;charset=utf-8" instead of "text/vcard"
This commit is contained in:
Florian Schlichting 2017-05-17 11:20:21 +02:00
parent 22e0e4aa38
commit b4a1e39d6d

View File

@ -218,7 +218,7 @@ class CalDAVRequest
}
$this->method = $_SERVER['REQUEST_METHOD'];
$this->content_type = (isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null);
if ( preg_match( '{^(\S+/\S+)\s*(;.*)?$}', $this->content_type, $matches ) ) {
if ( preg_match( '{^(\S+/\S+?)\s*(;.*)?$}', $this->content_type, $matches ) ) {
$this->content_type = $matches[1];
}
if ( strlen($c->raw_post) > 0 ) {