diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-03-13 16:54:27 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2017-03-24 11:06:44 +0100 |
commit | aa26a3ae749f624de63f9a274ff23d21c5160658 (patch) | |
tree | 92199275da2340be379ee8e114cd121ab8d80605 /apps | |
parent | e6371134523b6c263b37dd70878e7256cef53ecc (diff) | |
download | nextcloud-server-aa26a3ae749f624de63f9a274ff23d21c5160658.tar.gz nextcloud-server-aa26a3ae749f624de63f9a274ff23d21c5160658.zip |
use right format for avatars
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/CardDAV/Converter.php | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/CardDAV/ConverterTest.php | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/dav/lib/CardDAV/Converter.php b/apps/dav/lib/CardDAV/Converter.php index eb43fe7d671..9e106a0fe28 100644 --- a/apps/dav/lib/CardDAV/Converter.php +++ b/apps/dav/lib/CardDAV/Converter.php @@ -78,7 +78,7 @@ class Converter { break; case AccountManager::PROPERTY_AVATAR: if ($image !== null) { - $vCard->add('PHOTO', 'data:'.$image->mimeType().';base64,' . base64_encode($image->data())); + $vCard->add('PHOTO', $image->data(), ['ENCODING' => 'b', 'TYPE' => $image->mimeType()]); } break; case AccountManager::PROPERTY_EMAIL: diff --git a/apps/dav/tests/unit/CardDAV/ConverterTest.php b/apps/dav/tests/unit/CardDAV/ConverterTest.php index ff218bfc78c..448d80f3070 100644 --- a/apps/dav/tests/unit/CardDAV/ConverterTest.php +++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php @@ -146,7 +146,7 @@ class ConverterTest extends TestCase { [ 'cloud' => 'foo@cloud.net', 'email' => 'foo@bar.net', - 'photo' => 'data:image/jpeg;base64,MTIzNDU2Nzg5', + 'photo' => 'MTIzNDU2Nzg5', ], null, 'foo@bar.net', @@ -157,7 +157,7 @@ class ConverterTest extends TestCase { 'cloud' => 'foo@cloud.net', 'email' => 'foo@bar.net', 'fn' => 'Dr. Foo Bar', - 'photo' => 'data:image/jpeg;base64,MTIzNDU2Nzg5', + 'photo' => 'MTIzNDU2Nzg5', ], "Dr. Foo Bar", "foo@bar.net", @@ -167,7 +167,7 @@ class ConverterTest extends TestCase { [ 'cloud' => 'foo@cloud.net', 'fn' => 'Dr. Foo Bar', - 'photo' => 'data:image/jpeg;base64,MTIzNDU2Nzg5', + 'photo' => 'MTIzNDU2Nzg5', ], "Dr. Foo Bar", null, @@ -177,7 +177,7 @@ class ConverterTest extends TestCase { [ 'cloud' => 'foo@cloud.net', 'fn' => 'Dr. Foo Bar', - 'photo' => 'data:image/jpeg;base64,MTIzNDU2Nzg5', + 'photo' => 'MTIzNDU2Nzg5', ], 'Dr. Foo Bar', '', |