N°931 AttributeSet widget : better fix for crash when having a ' in the label

use htmlentities for input hidden value instead of a textarea display:none
This commit is contained in:
Pierre Goiffon
2018-09-28 09:02:27 +02:00
parent 3e8dd61607
commit a4315b4789

View File

@@ -2043,8 +2043,9 @@ EOF
/** @var \ormSet $value */
$sJson = $oAttDef->GetJsonForWidget($value, $aArgs);
$sEscapedJson = htmlentities($sJson);
$sSetInputName = "attr_{$sFormPrefix}{$sAttCode}";
$sHTMLValue = "<div class=\"field_input_zone field_input_set\"><textarea id='$iId' name='$sSetInputName' style='display: none;'> $sJson</textarea></div>{$sValidationSpan}{$sReloadSpan}";
$sHTMLValue = '<div class="field_input_zone field_input_set"><input id="'.$iId.'" name="'.$sSetInputName.'" type="hidden" value="'.$sEscapedJson.'"></div>'.$sValidationSpan.$sReloadSpan;
$sScript = "$('#$iId').set_widget();";
$oPage->add_ready_script($sScript);
break;