mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-15 04:24:41 +01:00
Fix old format vCard/vCalendar quoting issue
This commit is contained in:
parent
68cf0235e2
commit
ed79fca436
@ -848,13 +848,19 @@ class Horde_iCalendar {
|
|||||||
// String fields.
|
// String fields.
|
||||||
default:
|
default:
|
||||||
if ($this->isOldFormat()) {
|
if ($this->isOldFormat()) {
|
||||||
|
$value = trim($value);
|
||||||
// vCalendar 1.0 and vCard 2.1 only escape semicolons
|
// vCalendar 1.0 and vCard 2.1 only escape semicolons
|
||||||
// and use unescaped semicolons to create lists.
|
// and use unescaped semicolons to create lists.
|
||||||
$value = trim($value);
|
$value = str_replace(array('\\n', '\\N', '\\;', '\\:'),
|
||||||
|
array("\n", "\n", ';', ':'),
|
||||||
|
$value);
|
||||||
|
|
||||||
// Split by unescaped semicolons:
|
// Split by unescaped semicolons:
|
||||||
$values = preg_split('/(?<!\\\\);/', $value);
|
$values = preg_split('/(?<!\\\\);/', $value);
|
||||||
$value = str_replace('\\;', ';', $value);
|
$value = str_replace('\\;', ';', $value);
|
||||||
$values = str_replace('\\;', ';', $values);
|
$values = str_replace('\\;', ';', $values);
|
||||||
|
$value = str_replace('\\,', ',', $value);
|
||||||
|
$values = str_replace('\\,', ',', $values);
|
||||||
$this->setAttribute($tag, trim($value), $params, true, $values);
|
$this->setAttribute($tag, trim($value), $params, true, $values);
|
||||||
} else {
|
} else {
|
||||||
$value = trim($value);
|
$value = trim($value);
|
||||||
@ -869,7 +875,6 @@ class Horde_iCalendar {
|
|||||||
$values = preg_split('/(?<!\\\\),/', $value);
|
$values = preg_split('/(?<!\\\\),/', $value);
|
||||||
$value = str_replace('\\,', ',', $value);
|
$value = str_replace('\\,', ',', $value);
|
||||||
$values = str_replace('\\,', ',', $values);
|
$values = str_replace('\\,', ',', $values);
|
||||||
|
|
||||||
$this->setAttribute($tag, trim($value), $params, true, $values);
|
$this->setAttribute($tag, trim($value), $params, true, $values);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user