diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 225449b07e..78a0560fcd 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -118,14 +118,14 @@ $text_pattern = '/[^a-zA-Z0-9 _\-\/.\?:\=#\n]/'; //sanitize the data - $dashboard_name = trim(preg_replace('/[^a-zA-Z0-9 _\-\/.#]/', '', $dashboard_name)); + $dashboard_name = trim($dashboard_name); $dashboard_path = preg_replace($text_pattern, '', strtolower($dashboard_path)); $dashboard_icon = preg_replace($text_pattern, '', $dashboard_icon); $dashboard_url = trim(preg_replace($text_pattern, '', $dashboard_url)); $dashboard_target = trim(preg_replace($text_pattern, '', $dashboard_target)); $dashboard_width = trim(preg_replace($text_pattern, '', $dashboard_width)); $dashboard_height = trim(preg_replace($text_pattern, '', $dashboard_height)); - $dashboard_content = trim(preg_replace($text_pattern, '', $dashboard_content)); + $dashboard_content = trim($dashboard_content); $dashboard_content_text_align = trim(preg_replace($text_pattern, '', $dashboard_content_text_align)); $dashboard_content_details = trim(preg_replace($text_pattern, '', $dashboard_content_details)); $dashboard_chart_type = preg_replace($text_pattern, '', $dashboard_chart_type); diff --git a/core/dashboard/resources/dashboard/content.php b/core/dashboard/resources/dashboard/content.php index fcc2096d95..27d98202bf 100644 --- a/core/dashboard/resources/dashboard/content.php +++ b/core/dashboard/resources/dashboard/content.php @@ -14,6 +14,14 @@ if ($dashboard_content_length < 30) { $dashboard_content_text_vertical_align = 'middle'; } $dashboard_content_height = $dashboard_row_span * 120 . 'px'; +//escape the content and details + $dashboard_content = escape($dashboard_content); + $dashboard_content_details = escape($dashboard_content_details); + +//allow line breaks + $dashboard_content = str_replace('<br />', '
', $dashboard_content); + $dashboard_content_details = str_replace('<br />', '
', $dashboard_content_details); + //dashboard icon echo "
\n"; echo "
\n";