1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-19 08:52:22 +01:00

Contacts: sanitizeHTML

This commit is contained in:
Thomas Tanghus 2013-02-08 23:23:29 +01:00
parent 13c395e895
commit b6a25e62b2

View File

@ -753,7 +753,7 @@ class VCard {
$value = explode(':', $value);
$protocol = array_shift($value);
if(!isset($property['X-SERVICE-TYPE'])) {
$property['X-SERVICE-TYPE'] = strtoupper(strip_tags($protocol));
$property['X-SERVICE-TYPE'] = strtoupper(\OCP\Util::sanitizeHTML($protocol));
}
$value = implode('', $value);
}
@ -763,7 +763,7 @@ class VCard {
}
$temp = array(
//'name' => $property->name,
'value' => $value,
'value' => \OCP\Util::sanitizeHTML($value),
'parameters' => array()
);
@ -789,14 +789,14 @@ class VCard {
}
$pvalue = is_array($pvalue) ? $pvalue : array($pvalue);
if (isset($temp['parameters'][$parameter->name])) {
$temp['parameters'][$parameter->name][] = $pvalue;
$temp['parameters'][$parameter->name][] = \OCP\Util::sanitizeHTML($pvalue);
}
else {
$temp['parameters'][$parameter->name] = $pvalue;
$temp['parameters'][$parameter->name] = \OCP\Util::sanitizeHTML($pvalue);
}
}
else{
$temp['parameters'][$parameter->name] = $parameter->value;
$temp['parameters'][$parameter->name] = \OCP\Util::sanitizeHTML($parameter->value);
}
}
return $temp;