Skip the "text/calendar" record, so we don't run code that expects "="

Prevents this warning:
  PHP Warning:  Undefined array key 1 in inc/iSchedule-POST.php on line 96
This commit is contained in:
Andrew Ruthven 2024-03-30 20:08:14 +13:00
parent b26d48fced
commit ba4c1eb989

View File

@ -82,11 +82,16 @@ if ( $d->validateRequest ( ) ) {
// TODO: add originator addressbook and existing event lookup as whitelist
}
$method = $ical->GetPValue('METHOD');
$content_type = explode ( ';', $_SERVER['CONTENT_TYPE'] );
if ( $content_type[0] != 'text/calendar' )
$reply->XMLResponse( 406, 'content must be text/calendar' );
$content_parts = Array ();
foreach ( $content_type as $v ) {
if ($v == 'text/calendar')
continue;
list ( $a, $b ) = explode ( '=', trim ( $v ), 2 );
$content_parts[strtolower($a)] = strtoupper($b);
}