From 19fbfb034393e25bb42bdc00f2f13ae55ffaf4ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=81n=20Ma=CC=81te=CC=81?= Date: Mon, 22 Sep 2014 22:46:20 +0200 Subject: [PATCH] fix for debian bug #740827 - ensure that the timestamp inserted into the INSERT query is valid --- inc/caldav-PUT-vcard.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/caldav-PUT-vcard.php b/inc/caldav-PUT-vcard.php index 0da06bc3..419e2bc5 100644 --- a/inc/caldav-PUT-vcard.php +++ b/inc/caldav-PUT-vcard.php @@ -98,6 +98,11 @@ elseif( preg_match('{^(\d{8})(\d{6})Z?}', $last_modified, $matches) ) { $vcard->ClearProperties('REV'); $vcard->AddProperty('REV',$last_modified); } +elseif( !preg_match('{^\d{8}T\d{6}Z$}', $last_modified) ) { + $last_modified = gmdate( 'Ymd\THis\Z' ); + $vcard->ClearProperties('REV'); + $vcard->AddProperty('REV',$last_modified); +} $rendered_card = $vcard->Render(); $etag = md5($rendered_card);