fix for debian bug #740827 - ensure that the timestamp inserted into the INSERT query is valid

This commit is contained in:
Ján Máté 2014-09-22 22:46:20 +02:00
parent 0bbf51f92d
commit 19fbfb0343

View File

@ -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);