From ba4c1eb989ea27fa87b1391ff837515b59b6afb3 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sat, 30 Mar 2024 20:08:14 +1300 Subject: [PATCH] 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 --- inc/iSchedule-POST.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/iSchedule-POST.php b/inc/iSchedule-POST.php index aab2c74f..cf7fe6b4 100644 --- a/inc/iSchedule-POST.php +++ b/inc/iSchedule-POST.php @@ -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); }