(cp 813d53b21) fixes #2145 deal with array value in exif

This commit is contained in:
plegall
2024-04-10 12:25:11 +02:00
parent b04da9b811
commit 5678ca72d6
2 changed files with 17 additions and 3 deletions
+13 -1
View File
@@ -183,11 +183,23 @@ function get_exif_data($filename, $map)
if (!$conf['allow_html_in_metadata'])
{
function strip_html_in_metadata(&$v, $k)
{
$v = strip_tags($v);
}
foreach ($result as $key => $value)
{
// in case the origin of the photo is unsecure (user upload), we remove
// HTML tags to avoid XSS (malicious execution of javascript)
$result[$key] = strip_tags($value);
if (is_array($value))
{
array_walk_recursive($value, 'strip_html_in_metadata');
}
else
{
$result[$key] = strip_tags($value);
}
}
}