From 41c55d1913c80ef56a7c95e2550b23919071ae14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 4 Mar 2015 11:55:17 +0100 Subject: [PATCH] Better fix for bug-1825. There are actually a lot to things to escape and escaped methods can make conflict with similar names so it is better to make a md5 to have a unique value --- htdocs/comm/action/index.php | 2 +- htdocs/core/lib/agenda.lib.php | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 82e6818a250..ba697538de7 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1038,7 +1038,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $numicals[dol_string_nospecial($event->icalname)]++; } $color=$event->icalcolor; - $cssclass=(! empty($event->icalname)?'family_ext'.dol_string_nospecial($event->icalname):'family_other'); + $cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other'); } else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; } else { $numother++; $cssclass='family_other'; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 219b69015a0..e4885245675 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -140,25 +140,20 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh if (count($showextcals) > 0) { print ''; - //jQuery Learning "How do I select an element by an ID that has characters used in CSS notation?" - //http://learn.jquery.com/using-jquery-core/faq/how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation/ print ''; print ' ' . $langs->trans("LocalAgenda") . ''; foreach ($showextcals as $val) { - $htmlname = dol_string_nospecial($val['name']); + $htmlname = md5($val['name']); print ''; print ' ' . $val ['name'];