-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Milestone
Description
Steps to reproduce
- use the user_ldap plugin (which updates the avatar from LDAP after each login: https://github.com/owncloud/user_ldap/blob/master/lib/User/User.php#L474-L483)
- set a user image in LDAP
- watch as the PHOTO field is repeatedly added to the user's vCard blob in
oc_cards, until the database can hold no more (triggering Truncate Doctrine\DBAL\Exception\DriverException message if too long doctrine/dbal#2523 in passing)
Expected behaviour
Only one PHOTO field is present in the vCard
Actual behaviour
Duplicate PHOTO fields keep getting added to the user's vCard
Cause
Converter::updateCard unconditionally adds the given photo to the vCard, rather than replace it:
core/apps/dav/lib/CardDAV/Converter.php
Lines 93 to 96 in a9e633d
| if($this->propertyNeedsUpdate($vCard, 'PHOTO', $image)) { | |
| $vCard->add('PHOTO', $image->data(), ['ENCODING' => 'b', 'TYPE' => $image->mimeType()]); | |
| $updated = true; | |
| } |
unset($vCard->PHOTO);?
Server configuration
Operating system: OpenBSD 6.0
Web server: apache-httpd-2.4.23
Database: MySQL (mariadb-server-10.0.25p0v1)
PHP version: php-5.6.23p0
ownCloud version: (see ownCloud admin page) 9.0.2
Updated from an older ownCloud or fresh install: updated
Where did you install ownCloud from: OpenBSD ports