mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-18 07:52:21 +01:00
Strip control chars after decoding from quoted printable.
This commit is contained in:
parent
3be10d04fb
commit
e9315abed5
@ -149,7 +149,14 @@ class OC_Contacts_VCard {
|
|||||||
foreach($property->parameters as $key=>&$parameter){
|
foreach($property->parameters as $key=>&$parameter){
|
||||||
if(strtoupper($parameter->name) == 'ENCODING') {
|
if(strtoupper($parameter->name) == 'ENCODING') {
|
||||||
if(strtoupper($parameter->value) == 'QUOTED-PRINTABLE') { // what kind of other encodings could be used?
|
if(strtoupper($parameter->value) == 'QUOTED-PRINTABLE') { // what kind of other encodings could be used?
|
||||||
$property->value = quoted_printable_decode($property->value);
|
// Decode quoted-printable and strip any control chars
|
||||||
|
// except \n and \r
|
||||||
|
$property->value = preg_replace(
|
||||||
|
'/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]/'
|
||||||
|
, ''
|
||||||
|
,
|
||||||
|
quoted_printable_decode($property->value)
|
||||||
|
);
|
||||||
unset($property->parameters[$key]);
|
unset($property->parameters[$key]);
|
||||||
}
|
}
|
||||||
} elseif(strtoupper($parameter->name) == 'CHARSET') {
|
} elseif(strtoupper($parameter->name) == 'CHARSET') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user