diff options
Diffstat (limited to '3rdparty/Sabre/VObject')
-rw-r--r-- | 3rdparty/Sabre/VObject/Property.php | 38 | ||||
-rw-r--r-- | 3rdparty/Sabre/VObject/Reader.php | 12 | ||||
-rw-r--r-- | 3rdparty/Sabre/VObject/Version.php | 2 |
3 files changed, 42 insertions, 10 deletions
diff --git a/3rdparty/Sabre/VObject/Property.php b/3rdparty/Sabre/VObject/Property.php index 201e6356ad6..624dd4b8a58 100644 --- a/3rdparty/Sabre/VObject/Property.php +++ b/3rdparty/Sabre/VObject/Property.php @@ -128,6 +128,44 @@ class Sabre_VObject_Property extends Sabre_VObject_Element { } + /** + * Adds a new componenten or element + * + * You can call this method with the following syntaxes: + * + * add(Sabre_VObject_Parameter $element) + * add(string $name, $value) + * + * The first version adds an Parameter + * The second adds a property as a string. + * + * @param mixed $item + * @param mixed $itemValue + * @return void + */ + public function add($item, $itemValue = null) { + + if ($item instanceof Sabre_VObject_Parameter) { + if (!is_null($itemValue)) { + throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject'); + } + $this->parameters[] = $item; + } elseif(is_string($item)) { + + if (!is_scalar($itemValue)) { + throw new InvalidArgumentException('The second argument must be scalar'); + } + $this->parameters[] = new Sabre_VObject_Parameter($item,$itemValue); + + } else { + + throw new InvalidArgumentException('The first argument must either be a Sabre_VObject_Element or a string'); + + } + + } + + /* ArrayAccess interface {{{ */ /** diff --git a/3rdparty/Sabre/VObject/Reader.php b/3rdparty/Sabre/VObject/Reader.php index 9c20e33cea0..c38afbfb632 100644 --- a/3rdparty/Sabre/VObject/Reader.php +++ b/3rdparty/Sabre/VObject/Reader.php @@ -42,16 +42,10 @@ class Sabre_VObject_Reader { */ static function read($data) { - // Detecting line endings - if (strpos($data,"\r\n")!==false) { - $newLine = "\r\n"; - } elseif (strpos($data,"\r")) { - $newLine = "\r"; - } else { - $newLine = "\n"; - } + // Normalizing newlines + $data = str_replace(array("\r","\n\n"), array("\n","\n"), $data); - $lines = explode($newLine, $data); + $lines = explode("\n", $data); // Unfolding lines $lines2 = array(); diff --git a/3rdparty/Sabre/VObject/Version.php b/3rdparty/Sabre/VObject/Version.php index 8c3fe67b1f4..950c1c51104 100644 --- a/3rdparty/Sabre/VObject/Version.php +++ b/3rdparty/Sabre/VObject/Version.php @@ -14,7 +14,7 @@ class Sabre_VObject_Version { /** * Full version number */ - const VERSION = '1.2.0'; + const VERSION = '1.2.2'; /** * Stability : alpha, beta, stable |