Hi Benedikt,

> trying to push a event started befor 1900 results in a database error
> and therefor in a 500 response to the client.

could you say a little more about your patch, making it easier for me to
understand why it is effective on those particular dates (and does it
have effects on more current dates?), whether it's a change that might
need to be made in other parts of the code as well?

> A workaround patch is attached. 

Why is it a workaround, what would be the proper solution?

> diff --git a/inc/caldav-PUT-functions.php b/inc/caldav-PUT-functions.php
> index a1c9e3d..3f1b7d4 100644
> --- a/inc/caldav-PUT-functions.php
> +++ b/inc/caldav-PUT-functions.php
> @@ -1278,12 +1278,16 @@ function write_resource( DAVResource $resource, 
> $caldav_data, DAVResource $colle
>    if ( $first->GetType() == 'VTODO' ) $due = $first->GetPValue('DUE'); 
>    $calitem_params[':due'] = $due;
>    $dtstart = $first->GetPValue('DTSTART');
> -  if ( empty($dtstart) ) $dtstart = $due; 
> +  if ( empty($dtstart) ) $dtstart = $due;
> +  if (preg_match("/^[0-9][0-9][0-9][0-9][01][0-9][0-3][0-9]$/", $dtstart))
> +     $dtstart = $dtstart . "T000000Z";
>    $calitem_params[':dtstart'] = $dtstart;
>    
>    $dtend = $first->GetPValue('DTEND');
>    if ( isset($dtend) && $dtend != '' ) {
>      dbg_error_log( 'PUT', ' DTEND: "%s", DTSTART: "%s", DURATION: "%s"', 
> $dtend, $dtstart, $first->GetPValue('DURATION') );
> +    if (preg_match("/^[0-9][0-9][0-9][0-9][01][0-9][0-3][0-9]$/", $dtend))
> +       $dtend = $dtend . "T000000Z";
>      $calitem_params[':dtend'] = $dtend;
>      $dtend = ':dtend';
>    }


Florian


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to