Skip to content

Commit 5e25501

Browse files
author
Christian Putzke
committed
- bugfix: last_modified date is now STRING instead of INT
- CardDAV-Backend class update to v0.4.2
1 parent b61524c commit 5e25501

6 files changed

+16
-9
lines changed

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
changes from v0.2.3 to v0.2.4
2+
- bugfix: last_modified date is now STRING instead of INT
3+
- CardDAV-Backend class update to v0.4.2
4+
15
changes from v0.2.2 to v0.2.3
26
- added meetoo support
37
- CardDAV-Backend class update to v0.4.1

SQL/mysql.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS `carddav_contacts` (
33
`carddav_server_id` int(10) unsigned NOT NULL,
44
`user_id` int(10) unsigned NOT NULL,
55
`etag` varchar(64) NOT NULL,
6-
`last_modified` int(10) unsigned NOT NULL,
6+
`last_modified` VARCHAR(128) NOT NULL,
77
`vcard_id` varchar(64) NOT NULL,
88
`vcard` longtext NOT NULL,
99
`name` varchar(255) NOT NULL,

SQL/mysql.update.sql

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
// updates from version 0.2.3
2-
ALTER TABLE `carddav_contacts` ADD `last_modified` int(10) unsigned NOT NULL AFTER `etag`
2+
ALTER TABLE `carddav_contacts` ADD `last_modified` int(10) unsigned NOT NULL AFTER `etag` ;
3+
4+
// updates from version 0.2.4
5+
ALTER TABLE `carddav_contacts` CHANGE `last_modified` `last_modified` VARCHAR(128) NOT NULL ;

carddav.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @copyright Graviox Studios
1717
* @link http://www.graviox.de
1818
* @since 06.09.2011
19-
* @version 0.2.3
19+
* @version 0.2.4
2020
* @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later
2121
*
2222
*/

carddav_addressbook.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @copyright Graviox Studios
88
* @since 12.09.2011
99
* @link http://www.graviox.de
10-
* @version 0.2.3
10+
* @version 0.2.4
1111
* @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later
1212
*
1313
*/
@@ -427,12 +427,12 @@ public function carddav_addressbook_sync()
427427
{
428428
$element_id = (string) $element->id;
429429
$element_etag = (string) $element->etag;
430-
$element_last_modified = (int) $element->last_modified;
430+
$element_last_modified = (string) $element->last_modified;
431431

432432
if (isset($carddav_addressbook_contacts[$element_id]))
433433
{
434434
if ($carddav_addressbook_contacts[$element_id]['etag'] != $element_etag ||
435-
$carddav_addressbook_contacts[$element_id]['last_modified'] < $element_last_modified)
435+
$carddav_addressbook_contacts[$element_id]['last_modified'] != $element_last_modified)
436436
{
437437
$carddav_content = array(
438438
'vcard' => $carddav_backend->get_vcard($element_id),

carddav_backend.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* @copyright Graviox Studios
6767
* @link http://www.graviox.de
6868
* @since 20.07.2011
69-
* @version 0.4.1
69+
* @version 0.4.2
7070
* @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later
7171
*
7272
*/
@@ -99,7 +99,7 @@ class carddav_backend
9999
*
100100
* @var string
101101
*/
102-
protected $user_agent = 'CardDAV-PHP/0.4.1';
102+
protected $user_agent = 'CardDAV-PHP/0.4.2';
103103

104104
/**
105105
* constructor
@@ -261,7 +261,7 @@ private function simplify($response, $include_vcards = true)
261261
$simplified_xml->startElement('element');
262262
$simplified_xml->writeElement('id', $id);
263263
$simplified_xml->writeElement('etag', str_replace('"', null, $response->propstat->prop->getetag));
264-
$simplified_xml->writeElement('last_modified', strtotime($response->propstat->prop->getlastmodified));
264+
$simplified_xml->writeElement('last_modified', $response->propstat->prop->getlastmodified);
265265

266266
if ($include_vcards === true)
267267
{

0 commit comments

Comments
 (0)