diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 50d0e8ee9e3..24557d1e90e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6521,7 +6521,8 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, { $allowed_tags = array( "html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link", - "ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6" + "ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6", + "comment" // this tags is added to manage comment that are replaced into ... ); if ($allowiframe) { $allowed_tags[] = "iframe"; @@ -6534,7 +6535,8 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, $stringtoclean = dol_string_nounprintableascii($stringtoclean, 0); - $stringtoclean = preg_replace('//', '', $stringtoclean); + //$stringtoclean = preg_replace('//', '', $stringtoclean); + $stringtoclean = preg_replace('//', '\1', $stringtoclean); $stringtoclean = preg_replace('/:/i', ':', $stringtoclean); $stringtoclean = preg_replace('/:|�+58|:/i', '', $stringtoclean); // refused string ':' encoded (no reason to have a : encoded like this) to disable 'javascript:...' @@ -6557,6 +6559,9 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, $temp = str_replace('__!DOCTYPE_HTML__', '', $temp); // Restore the DOCTYPE + $temp = preg_replace('/([^>]*)<\/comment>/', '', $temp); // Restore html comments + + return $temp; } diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1a5987f3e80..95e83c3ed39 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1641,6 +1641,7 @@ if ($action == 'savefile' && empty($cancel)) { $content = GETPOST('editfilecontent', $check); + // Save file on disk if ($content) { dol_delete_file($pathoffile); @@ -2128,7 +2129,9 @@ if ($module == 'initmodule') { print ''; print $langs->trans("EditorUrl"); print ''; - print $moduleobj->editor_url; + if (!empty($moduleobj->editor_url)) { + print ''.$moduleobj->editor_url.' '.img_picto('', 'globe').''; + } print ''; print '';