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

- 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.
- Change how smarty tags filtering, undoing the change if incorrect on a smarty.
This commit is contained in:
Hector Cortez
2013-07-08 09:32:33 -04:00
parent 68a9ad9702
commit 1b5bf27a26

View File

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