From cb41a30b00ef8d31676989017fa2b9ad416659b9 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Wed, 15 May 2013 18:56:54 +0200 Subject: Add Compound property to avoid double escaping values. --- lib/vobject/compoundproperty.php | 70 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 lib/vobject/compoundproperty.php (limited to 'lib') diff --git a/lib/vobject/compoundproperty.php b/lib/vobject/compoundproperty.php new file mode 100644 index 00000000000..d702ab802e0 --- /dev/null +++ b/lib/vobject/compoundproperty.php @@ -0,0 +1,70 @@ +. + * + */ + +namespace OC\VObject; + +/** + * This class overrides \Sabre\VObject\Property::serialize() to not + * double escape commas and semi-colons in compound properties. +*/ +class CompoundProperty extends \Sabre\VObject\Property\Compound { + + /** + * Turns the object back into a serialized blob. + * + * @return string + */ + public function serialize() { + + $str = $this->name; + if ($this->group) { + $str = $this->group . '.' . $this->name; + } + + foreach($this->parameters as $param) { + $str.=';' . $param->serialize(); + } + $src = array( + "\n", + ); + $out = array( + '\n', + ); + $str.=':' . str_replace($src, $out, $this->value); + + $out = ''; + while(strlen($str) > 0) { + if (strlen($str) > 75) { + $out .= mb_strcut($str, 0, 75, 'utf-8') . "\r\n"; + $str = ' ' . mb_strcut($str, 75, strlen($str), 'utf-8'); + } else { + $out .= $str . "\r\n"; + $str = ''; + break; + } + } + + return $out; + + } + +} \ No newline at end of file -- cgit v1.2.3 From c50bf3e3c54ccbad6b58538fb131924d4f0ff3d7 Mon Sep 17 00:00:00 2001 From: Florin Peter Date: Wed, 15 May 2013 10:19:38 +0200 Subject: fix for losing mount point "/" --- lib/files/filesystem.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index eadd8a93faf..d60d430d77c 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -222,7 +222,10 @@ class Filesystem { return false; } self::$defaultInstance = new View($root); - self::$mounts = new Mount\Manager(); + + if(!self::$mounts) { + self::$mounts = new Mount\Manager(); + } //load custom mount config self::initMountPoints($user); -- cgit v1.2.3