diff options
author | zotlabs <mike@macgirvin.com> | 2017-12-21 13:36:33 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-12-21 13:36:33 -0800 |
commit | e7143a265ac97b31a8e0ada85b876ba76c911a3d (patch) | |
tree | dfa42a02359701960f525d10a22e1ebca5b82873 /vendor/sabre/vobject/lib/Component.php | |
parent | 684b572aa8005479f3eb219fc526c812c801ca76 (diff) | |
parent | 9c72963d7ce3c60709755edb5d40cb0b06b29cda (diff) | |
download | volse-hubzilla-e7143a265ac97b31a8e0ada85b876ba76c911a3d.tar.gz volse-hubzilla-e7143a265ac97b31a8e0ada85b876ba76c911a3d.tar.bz2 volse-hubzilla-e7143a265ac97b31a8e0ada85b876ba76c911a3d.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'vendor/sabre/vobject/lib/Component.php')
-rw-r--r-- | vendor/sabre/vobject/lib/Component.php | 17 |
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, ]; |