From 7079110c61d41020912baab91cef8b3a3acdb577 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 8 May 2014 15:08:45 +0200 Subject: Allow data-* attributes (#1489860) --- program/include/rcmail_output_html.php | 2 +- program/lib/Roundcube/html.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'program') diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php index 1b836ab7d..42b208e89 100644 --- a/program/include/rcmail_output_html.php +++ b/program/include/rcmail_output_html.php @@ -1232,7 +1232,7 @@ EOF; // generate html code for button if ($btn_content) { - $attrib_str = html::attrib_string($attrib, array_merge($link_attrib, array('data-*'))); + $attrib_str = html::attrib_string($attrib, $link_attrib); $out = sprintf('%s', $attrib_str, $btn_content); } diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php index f47ef299a..a88570d75 100644 --- a/program/lib/Roundcube/html.php +++ b/program/lib/Roundcube/html.php @@ -283,10 +283,9 @@ class html continue; } - // ignore not allowed attributes + // ignore not allowed attributes, except data-* if (!empty($allowed)) { - $is_data_attr = @substr_compare($key, 'data-', 0, 5) === 0; - if (!isset($allowed_f[$key]) && (!$is_data_attr || !isset($allowed_f['data-*']))) { + if (!isset($allowed_f[$key]) && @substr_compare($key, 'data-', 0, 5) !== 0) { continue; } } -- cgit v1.2.3