From 147abf71c6196688957ad1efe2ee80ce6416deb4 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 5 Oct 2011 17:00:37 +0200 Subject: [PATCH] When we create a timezone on PUT we should set the last_modified. Ideally from the LAST-MODIFIED property in the VTIMEZONE, but failing that we should at least use the gmdate() of the current time. --- inc/caldav-PUT-functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/caldav-PUT-functions.php b/inc/caldav-PUT-functions.php index 1d94b1e0..37825de9 100644 --- a/inc/caldav-PUT-functions.php +++ b/inc/caldav-PUT-functions.php @@ -566,7 +566,11 @@ EOSQL; if ( $qry->Exec('PUT',__LINE__,__FILE__) && $qry->rows() == 0 ) { $params[':olson_name'] = $olson; $params[':vtimezone'] = (isset($tz) ? $tz->Render() : null ); - $qry->QDo('INSERT INTO timezones (tzid, olson_name, active, vtimezone) VALUES(:tzid,:olson_name,false,:vtimezone)', $params ); + $params[':last_modified'] = (isset($tz) ? $tz->GetPValue('LAST-MODIFIED') : null ); + if ( empty($params[':last_modified']) ) { + $params[':last_modified'] = gmdate('Ymd\THis\Z'); + } + $qry->QDo('INSERT INTO timezones (tzid, olson_name, active, vtimezone, last_modified) VALUES(:tzid,:olson_name,false,:vtimezone,:last_modified)', $params ); } } else {