On Tue, 16 Dec 2014 08:49:38 +0100 Florian Schlichting <f...@debian.org>
wrote:

Hi Florian, 
> > 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?
The underlaying database refuses to accept "18961224" as date while
"19011224" works out pretty well. My "works for me" changes "18961224"
or "19011224" into "18961224T000000Z" or "19011224T000000Z" which both
are accepted as dates.

> > A workaround patch is attached. 
> Why is it a workaround, what would be the proper solution?
Better: It is a "works for me". It may wash your windows,
mend your fences, mow your lawn...

> > 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';
> >    }


-- 
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