Fixed result div for string modules bug

This commit is contained in:
Luis Calvo 2020-07-23 17:28:44 +02:00
parent ce6d54e32f
commit 158cbc74e2
1 changed files with 1 additions and 6 deletions

View File

@ -3879,21 +3879,16 @@ function html_print_timezone_select($name, $selected='')
* Enclose a text into a result_div
*
* @param string Text to enclose
* @param boolean Return formatted text without html tags.
*
* @return string Text inside the result_div
*/
function html_print_result_div($text, $text_only)
function html_print_result_div($text)
{
$text = preg_replace('/</', '&lt;', $text);
$text = preg_replace('/>/', '&gt;', $text);
$text = preg_replace('/\n/i', '<br>', $text);
$text = preg_replace('/\s/i', '&nbsp;', $text);
if ($text_only) {
return $text;
}
$enclose = "<div id='result_div' style='width: 100%; height: 100%; overflow: auto; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left'>";
$enclose .= $text;
$enclose .= '</div>';