aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Component.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-03-09 11:12:18 +0100
committerMario <mario@mariovavti.com>2018-03-09 11:12:18 +0100
commit4baf5eab16d809977a44e7911ddcab0ff8383897 (patch)
tree393f618c4cfc20f53264ecd8a26a08de0823d35d /vendor/sabre/vobject/lib/Component.php
parent577da0eb9eb1f90a4cf7a70cfb3582cfb49007ac (diff)
parent7361af85b5488fc8bd1744389a3a332dc74276b0 (diff)
downloadvolse-hubzilla-4baf5eab16d809977a44e7911ddcab0ff8383897.tar.gz
volse-hubzilla-4baf5eab16d809977a44e7911ddcab0ff8383897.tar.bz2
volse-hubzilla-4baf5eab16d809977a44e7911ddcab0ff8383897.zip
Merge branch '3.2RC'3.2
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,
];