aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Component.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-12-18 15:48:49 +0100
committerMario Vavti <mario@mariovavti.com>2017-12-18 15:48:49 +0100
commit439d41b194073285ab97be94253b3f4cb4395e43 (patch)
tree272d4c64ea2d766235ecb41009117b5269f8cdfd /vendor/sabre/vobject/lib/Component.php
parent08a8f195e749a120642f6c486c1dad62a73924d1 (diff)
downloadvolse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.gz
volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.bz2
volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.zip
install smarty via composer and update other php libs
Diffstat (limited to 'vendor/sabre/vobject/lib/Component.php')
-rw-r--r--vendor/sabre/vobject/lib/Component.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/vendor/sabre/vobject/lib/Component.php b/vendor/sabre/vobject/lib/Component.php
index 9a10ed3f8..ac87a10ec 100644
--- a/vendor/sabre/vobject/lib/Component.php
+++ b/vendor/sabre/vobject/lib/Component.php
@@ -662,8 +662,23 @@ class Component extends Node {
break;
case '?' :
if (isset($propertyCounters[$propName]) && $propertyCounters[$propName] > 1) {
+ $level = 3;
+
+ // We try to repair the same property appearing multiple times with the exact same value
+ // by removing the duplicates and keeping only one property
+ if ($options & self::REPAIR) {
+ $properties = array_unique($this->select($propName), SORT_REGULAR);
+
+ if (count($properties) === 1) {
+ $this->remove($propName);
+ $this->add($properties[0]);
+
+ $level = 1;
+ }
+ }
+
$messages[] = [
- 'level' => 3,
+ 'level' => $level,
'message' => $propName . ' MUST NOT appear more than once in a ' . $this->name . ' component',
'node' => $this,
];