From 65860b59b8c55ddc536dcb8c2e18154583220f2c Mon Sep 17 00:00:00 2001 From: Hector Cortez Date: Wed, 26 Jun 2013 11:18:51 -0400 Subject: [PATCH] BUG 12118 Fatal error en un dynaform cuando se habilita el html SOLVED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- workflow/engine/classes/class.dynaformEditor.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/workflow/engine/classes/class.dynaformEditor.php b/workflow/engine/classes/class.dynaformEditor.php index c74d811d2..9eddb2865 100755 --- a/workflow/engine/classes/class.dynaformEditor.php +++ b/workflow/engine/classes/class.dynaformEditor.php @@ -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("{", "{", $value); + $aTagVar = str_replace("}", "}", $aTagVar); + $aTagVar = str_replace("$", "$", $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';