BUG 12118 Fatal error en un dynaform cuando se habilita el html SOLVED

- Comportamiento actual. En linux, cuando se da click en enable html para habilitar la edición de un dynaform, luego de guardar y volver a preview se da un fatal error.
- Validation of modified smarty fields in html, and change to html entities.
This commit is contained in:
Hector Cortez
2013-06-26 11:18:51 -04:00
parent 597125dd71
commit 65860b59b8

View File

@@ -543,6 +543,18 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
public function set_htmlcode($A, $htmlcode)
{
try {
$iOcurrences = preg_match_all('/\{[\S*\<[^\>]*\S*\s*\>*\S*]*\$\S*\<[^\>]*\S*\s*\>*\S*\}/im', $htmlcode, $matches);
if ($iOcurrences) {
if (isset($matches[0])) {
$tagsHtml = $matches[0];
foreach ($tagsHtml as $value) {
$aTagVar = str_replace("{", "&#123;", $value);
$aTagVar = str_replace("}", "&#125;", $aTagVar);
$aTagVar = str_replace("$", "&#36;", $aTagVar);
$htmlcode = str_replace($value, $aTagVar, $htmlcode);
}
}
}
$file = G::decrypt($A, URL_KEY);
$form = new Form($file, PATH_DYNAFORM, SYS_LANG, true);
$filename = substr($form->fileName, 0, - 3) . ($form->type === 'xmlform' ? '' : '.' . $form->type) . 'html';