diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-08-14 20:06:22 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-08-14 20:06:45 +0200 |
commit | a75870489c87211f2619fd21c2b4ea9aae168877 (patch) | |
tree | 40af1aee510eb2a56b04d51f6ce40e4c4178518f | |
parent | db5b995a6befeb79035087518573c003fad5c30c (diff) | |
download | nextcloud-server-a75870489c87211f2619fd21c2b4ea9aae168877.tar.gz nextcloud-server-a75870489c87211f2619fd21c2b4ea9aae168877.zip |
Use correct class.
-rw-r--r-- | apps/contacts/ajax/contact/add.php | 6 | ||||
-rw-r--r-- | apps/contacts/ajax/contact/details.php | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/apps/contacts/ajax/contact/add.php b/apps/contacts/ajax/contact/add.php index 043e947dc4b..c7cec7d9461 100644 --- a/apps/contacts/ajax/contact/add.php +++ b/apps/contacts/ajax/contact/add.php @@ -49,10 +49,14 @@ if(!$id) { exit(); } +$lastmodified = OC_Contacts_App::lastModified($vcard); +if(!$lastmodified) { + $lastmodified = new DateTime(); +} OCP\JSON::success(array( 'data' => array( 'id' => $id, 'aid' => $aid, - 'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U') + 'lastmodified' => $lastmodified->format('U') ) )); diff --git a/apps/contacts/ajax/contact/details.php b/apps/contacts/ajax/contact/details.php index c22f18937d7..5bf337e645e 100644 --- a/apps/contacts/ajax/contact/details.php +++ b/apps/contacts/ajax/contact/details.php @@ -50,9 +50,13 @@ if(isset($details['PHOTO'])) { } else { $details['PHOTO'] = false; } +$lastmodified = OC_Contacts_App::lastModified($vcard); +if(!$lastmodified) { + $lastmodified = new DateTime(); +} $details['id'] = $id; $details['displayname'] = $card['fullname']; $details['addressbookid'] = $card['addressbookid']; -$details['lastmodified'] = OC_Contacts_App::lastModified($vcard)->format('U'); +$details['lastmodified'] = $lastmodified->format('U'); OC_Contacts_App::setLastModifiedHeader($vcard); OCP\JSON::success(array('data' => $details)); |