From 2ca46e0366b03f93e14037e6a8ff20e583913579 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Fri, 15 Aug 2014 13:08:59 -0500 Subject: [PATCH] forms: Fix html rendering of checkbox description --- include/class.forms.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/class.forms.php b/include/class.forms.php index e782f3ef2..dbdfd3790 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -616,6 +616,14 @@ class TextareaField extends FormField { return (!$value) ? $value : Format::html2text($value); } + function parse($value) { + $config = $this->getConfiguration(); + if ($config['html']) + return Format::sanitize($value); + else + return $value; + } + } class PhoneField extends FormField { @@ -1029,8 +1037,10 @@ class TextareaWidget extends Widget { $cols = "cols=\"{$config['cols']}\""; if (isset($config['length']) && $config['length']) $maxlength = "maxlength=\"{$config['length']}\""; - if (isset($config['html']) && $config['html']) + if (isset($config['html']) && $config['html']) { $class = 'class="richtext no-bar small"'; + $this->value = Format::viewableImages($this->value); + } ?> <span style="display:inline-block;width:100%"> <textarea <?php echo $rows." ".$cols." ".$maxlength." ".$class @@ -1126,13 +1136,13 @@ class CheckboxWidget extends Widget { if (!isset($this->value)) $this->value = $this->field->get('default'); ?> - <input type="checkbox" name="<?php echo $this->name; ?>[]" <?php + <input style="vertical-align:top;" type="checkbox" name="<?php echo $this->name; ?>[]" <?php if ($this->value) echo 'checked="checked"'; ?> value="<?php echo $this->field->get('id'); ?>"/> <?php if ($config['desc']) { ?> <em style="display:inline-block"><?php - echo Format::htmlchars($config['desc']); ?></em> + echo Format::viewableImages($config['desc']); ?></em> <?php } } -- GitLab