Commit c8f73cea authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch 'cherry-pick-87ca56dd' into '1.2.1-fixes'

Merge branch '5730-php-error-htmlentities-expects-parameter-… into '1.2.1-fixes'

See merge request fusiondirectory/fd!341
Showing with 12 additions and 1 deletion
+12 -1
...@@ -566,7 +566,18 @@ class Attribute ...@@ -566,7 +566,18 @@ class Attribute
{ {
if ($this->visible) { if ($this->visible) {
if ($readOnly) { if ($readOnly) {
$input = '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}'; $value = $this->getValue();
if (is_array($value)) {
$input = '{literal}'.implode('<br/>', array_map(
function ($v)
{
return htmlentities($v, ENT_COMPAT, 'UTF-8');
},
$value
)).'{/literal}';
} else {
$input = '{literal}'.htmlentities($value, ENT_COMPAT, 'UTF-8').'{/literal}';
}
} elseif (is_object($this->plugin) && $this->plugin->is_template) { } elseif (is_object($this->plugin) && $this->plugin->is_template) {
$input = $this->renderTemplateInput(); $input = $this->renderTemplateInput();
} else { } else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment