Fixed HTML entities handling in task list names

This commit is contained in:
Aleksander Machniak 2012-10-29 20:41:50 +01:00
parent 04793bfaf3
commit 9d9262d71f
2 changed files with 5 additions and 2 deletions

View file

@ -76,6 +76,7 @@ class tasklist_database_driver extends tasklist_driver
while ($result && ($arr = $this->rc->db->fetch_assoc($result))) { while ($result && ($arr = $this->rc->db->fetch_assoc($result))) {
$arr['showalarms'] = intval($arr['showalarms']); $arr['showalarms'] = intval($arr['showalarms']);
$arr['active'] = !in_array($arr['id'], $hidden); $arr['active'] = !in_array($arr['id'], $hidden);
$arr['name'] = html::quote($arr['name']);
$arr['editable'] = true; $arr['editable'] = true;
$this->lists[$arr['id']] = $arr; $this->lists[$arr['id']] = $arr;
$list_ids[] = $this->rc->db->quote($arr['id']); $list_ids[] = $this->rc->db->quote($arr['id']);

View file

@ -113,7 +113,7 @@ class tasklist_ui
$li .= html::tag('li', array('id' => 'rcmlitasklist' . $html_id, 'class' => $class), $li .= html::tag('li', array('id' => 'rcmlitasklist' . $html_id, 'class' => $class),
html::tag('input', array('type' => 'checkbox', 'name' => '_list[]', 'value' => $id, 'checked' => $prop['active'])) . html::tag('input', array('type' => 'checkbox', 'name' => '_list[]', 'value' => $id, 'checked' => $prop['active'])) .
html::span('handle', ' ') . html::span('handle', ' ') .
html::span('listname', Q($prop['name']))); html::span('listname', $prop['name']));
} }
$this->rc->output->set_env('tasklists', $jsenv); $this->rc->output->set_env('tasklists', $jsenv);
@ -128,8 +128,10 @@ class tasklist_ui
*/ */
function tasklist_select($attrib = array()) function tasklist_select($attrib = array())
{ {
$attrib['name'] = 'list'; $attrib['name'] = 'list';
$attrib['is_escaped'] = true;
$select = new html_select($attrib); $select = new html_select($attrib);
foreach ((array)$this->plugin->driver->get_lists() as $id => $prop) { foreach ((array)$this->plugin->driver->get_lists() as $id => $prop) {
if ($prop['editable']) if ($prop['editable'])
$select->add($prop['name'], $id); $select->add($prop['name'], $id);