1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Add CardDAV ValidatorPlugin

This commit is contained in:
Thomas Tanghus 2013-09-16 06:07:53 +02:00
parent e366bd7e4d
commit e7f17bdcb6

View File

@ -47,9 +47,9 @@ class ValidatorPlugin extends \Sabre_DAV_ServerPlugin {
* @param resource $data
* @return void
*/
public function beforeWriteContent($path, \Sabre_DAV_IFile $node, &$data) {
public function beforeWriteContent($path, Sabre_DAV_IFile $node, &$data) {
if (!$node instanceof \Sabre_CardDAV_ICard) {
if (!$node instanceof Sabre_CardDAV_ICard) {
return;
}
@ -94,7 +94,7 @@ class ValidatorPlugin extends \Sabre_DAV_ServerPlugin {
}
// Converting the data to unicode, if needed.
$data = \Sabre_DAV_StringUtil::ensureUTF8($data);
$data = Sabre_DAV_StringUtil::ensureUTF8($data);
try {
@ -102,14 +102,14 @@ class ValidatorPlugin extends \Sabre_DAV_ServerPlugin {
} catch (VObject\ParseException $e) {
throw new \Sabre_DAV_Exception_UnsupportedMediaType(
throw new Sabre_DAV_Exception_UnsupportedMediaType(
'This resource only supports valid vcard data. Parse error: ' . $e->getMessage()
);
}
if ($vobj->name !== 'VCARD') {
throw new \Sabre_DAV_Exception_UnsupportedMediaType(
throw new Sabre_DAV_Exception_UnsupportedMediaType(
'This collection can only support vcard objects.'
);
}