diff options
author | Mario <mario@mariovavti.com> | 2019-04-25 11:24:09 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-04-25 11:24:09 +0200 |
commit | f1c07977809ce3221286d53e99f0d91145b1166f (patch) | |
tree | 4c067a3b701ea56f10070c386b26a30f93666eb0 /vendor/sabre/vobject/lib/Property/Binary.php | |
parent | 701167bc125700efb3e6ce759b85bcb4d36ee42e (diff) | |
download | volse-hubzilla-f1c07977809ce3221286d53e99f0d91145b1166f.tar.gz volse-hubzilla-f1c07977809ce3221286d53e99f0d91145b1166f.tar.bz2 volse-hubzilla-f1c07977809ce3221286d53e99f0d91145b1166f.zip |
Revert "update composer libs"
This reverts commit e779335d060b3a51d6a144d23af4097ae6801473
Diffstat (limited to 'vendor/sabre/vobject/lib/Property/Binary.php')
-rw-r--r-- | vendor/sabre/vobject/lib/Property/Binary.php | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/vendor/sabre/vobject/lib/Property/Binary.php b/vendor/sabre/vobject/lib/Property/Binary.php index 830dd9028..d54cae25d 100644 --- a/vendor/sabre/vobject/lib/Property/Binary.php +++ b/vendor/sabre/vobject/lib/Property/Binary.php @@ -18,8 +18,8 @@ use Sabre\VObject\Property; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Binary extends Property -{ +class Binary extends Property { + /** * In case this is a multi-value property. This string will be used as a * delimiter. @@ -34,18 +34,25 @@ class Binary extends Property * This may be either a single, or multiple strings in an array. * * @param string|array $value + * + * @return void */ - public function setValue($value) - { + function setValue($value) { + if (is_array($value)) { - if (1 === count($value)) { + + if (count($value) === 1) { $this->value = $value[0]; } else { throw new \InvalidArgumentException('The argument must either be a string or an array with only one child'); } + } else { + $this->value = $value; + } + } /** @@ -55,10 +62,13 @@ class Binary extends Property * not yet done, but parameters are not included. * * @param string $val + * + * @return void */ - public function setRawMimeDirValue($val) - { + function setRawMimeDirValue($val) { + $this->value = base64_decode($val); + } /** @@ -66,9 +76,10 @@ class Binary extends Property * * @return string */ - public function getRawMimeDirValue() - { + function getRawMimeDirValue() { + return base64_encode($this->value); + } /** @@ -79,9 +90,10 @@ class Binary extends Property * * @return string */ - public function getValueType() - { + function getValueType() { + return 'BINARY'; + } /** @@ -91,9 +103,10 @@ class Binary extends Property * * @return array */ - public function getJsonValue() - { + function getJsonValue() { + return [base64_encode($this->getValue())]; + } /** @@ -102,10 +115,14 @@ class Binary extends Property * The value must always be an array. * * @param array $value + * + * @return void */ - public function setJsonValue(array $value) - { + function setJsonValue(array $value) { + $value = array_map('base64_decode', $value); parent::setJsonValue($value); + } + } |