Fixes for html_ent branch in ROundcube core: Proper HTML entities handling

This commit is contained in:
Aleksander Machniak 2012-09-20 15:56:54 +02:00
parent 7651e5de39
commit f693e2d183
4 changed files with 10 additions and 9 deletions

View file

@ -404,7 +404,7 @@ class calendar extends rcube_plugin
$select_cal = new html_select(array('name' => '_default_calendar', 'id' => $field_id)); $select_cal = new html_select(array('name' => '_default_calendar', 'id' => $field_id));
foreach ((array)$this->driver->list_calendars() as $id => $prop) { foreach ((array)$this->driver->list_calendars() as $id => $prop) {
if (!$prop['readonly']) if (!$prop['readonly'])
$select_cal->add($prop['name'], strval($id)); $select_cal->add(html_entity_decode($prop['name'], ENT_COMPAT, 'UTF-8'), strval($id));
if ($prop['default']) if ($prop['default'])
$default_calendar = $id; $default_calendar = $id;
} }
@ -712,7 +712,7 @@ class calendar extends rcube_plugin
$numcals = 0; $numcals = 0;
foreach ($calendars as $calendar) { foreach ($calendars as $calendar) {
if (!$calendar['readonly']) { if (!$calendar['readonly']) {
$calendar_select->add($calendar['name'], $calendar['id']); $calendar_select->add(html_entity_decode($calendar['name'], ENT_COMPAT, 'UTF-8'), $calendar['id']);
$numcals++; $numcals++;
} }
} }

View file

@ -206,7 +206,7 @@ class calendar_ui
$li .= html::tag('li', array('id' => 'rcmlical' . $html_id, 'class' => $class), $li .= html::tag('li', array('id' => 'rcmlical' . $html_id, 'class' => $class),
html::tag('input', array('type' => 'checkbox', 'name' => '_cal[]', 'value' => $id, 'checked' => $prop['active']), '') . html::tag('input', array('type' => 'checkbox', 'name' => '_cal[]', 'value' => $id, 'checked' => $prop['active']), '') .
html::span('handle', ' ') . html::span('handle', ' ') .
html::span('calname', Q($prop['name']))); html::span('calname', Q(html_entity_decode($prop['name'], ENT_COMPAT, 'UTF-8'))));
} }
$this->rc->output->set_env('calendars', $jsenv); $this->rc->output->set_env('calendars', $jsenv);
@ -252,7 +252,7 @@ class calendar_ui
$select = new html_select($attrib); $select = new html_select($attrib);
foreach ((array)$this->cal->driver->list_calendars() as $id => $prop) { foreach ((array)$this->cal->driver->list_calendars() as $id => $prop) {
if (!$prop['readonly']) if (!$prop['readonly'])
$select->add($prop['name'], $id); $select->add(html_entity_decode($prop['name'], ENT_COMPAT, 'UTF-8'), $id);
} }
return $select->show(null); return $select->show(null);

View file

@ -162,7 +162,7 @@ class kolab_activesync_ui
$length = strlen($names[$i].' » '); $length = strlen($names[$i].' » ');
$prefix = substr($foldername, 0, $length); $prefix = substr($foldername, 0, $length);
$count = count(explode(' » ', $prefix)); $count = count(explode(' » ', $prefix));
$foldername = str_repeat('  ', $count-1) . '» ' . substr($foldername, $length); $foldername = str_repeat('  ', $count-1) . '» ' . html::quote(substr($foldername, $length));
break; break;
} }
} }
@ -171,14 +171,14 @@ class kolab_activesync_ui
$classes = array('mailbox'); $classes = array('mailbox');
if ($folder_class = rcmail_folder_classname($folder)) { if ($folder_class = rcmail_folder_classname($folder)) {
$foldername = rcube_label($folder_class); $foldername = html::quote(rcube_label($folder_class));
$classes[] = $folder_class; $classes[] = $folder_class;
} }
$folder_id = 'rcmf' . html_identifier($folder); $folder_id = 'rcmf' . html_identifier($folder);
$padding = str_repeat('    ', $level); $padding = str_repeat('    ', $level);
$table->add_row(array('class' => (($level+1) * $idx++) % 2 == 0 ? 'even' : 'odd')); $table->add_row();
$table->add('subscription', $checkbox_sync->show( $table->add('subscription', $checkbox_sync->show(
!empty($subscribed[$folder]) ? $folder : null, !empty($subscribed[$folder]) ? $folder : null,
array('value' => $folder, 'id' => $folder_id))); array('value' => $folder, 'id' => $folder_id)));
@ -189,7 +189,7 @@ class kolab_activesync_ui
array('value' => $folder, 'id' => $folder_id.'_alarm'))); array('value' => $folder, 'id' => $folder_id.'_alarm')));
} }
$table->add(join(' ', $classes), html::label($folder_id, $padding . Q($foldername))); $table->add(join(' ', $classes), html::label($folder_id, $padding . $foldername));
} }
return $table->show(); return $table->show();

View file

@ -481,6 +481,7 @@ class kolab_storage
$names = array(); $names = array();
// Build SELECT field of parent folder // Build SELECT field of parent folder
$attrs['is_escaped'] = true;
$select = new html_select($attrs); $select = new html_select($attrs);
$select->add('---', ''); $select->add('---', '');
@ -494,7 +495,7 @@ class kolab_storage
$length = strlen($names[$i].' » '); $length = strlen($names[$i].' » ');
$prefix = substr($name, 0, $length); $prefix = substr($name, 0, $length);
$count = count(explode(' » ', $prefix)); $count = count(explode(' » ', $prefix));
$name = str_repeat('  ', $count-1) . '» ' . substr($name, $length); $name = str_repeat('  ', $count-1) . '» ' . html::quote(substr($name, $length));
break; break;
} }
} }