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,15 +543,15 @@ 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);
$iOcurrences = preg_match_all('/\{\$\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);
$aTagVar = strip_tags($value);
if ($value != $aTagVar) {
$htmlcode = str_replace($value, $aTagVar, $htmlcode);
}
}
}
}