fixed error data string show

This commit is contained in:
daniel 2018-07-27 14:07:02 +02:00
parent 284f992819
commit d740240a51
3 changed files with 21 additions and 8 deletions

View File

@ -355,7 +355,15 @@ if ($get_module_detail) {
if($data_macro){
$data[] = $data_macro;
} else {
$data[] = $row[$attr[0]];
$datos = $row[$attr[0]];
$datos = preg_replace ('/</', '&lt;', $datos);
$datos = preg_replace ('/>/', '&gt;', $datos);
$datos = preg_replace ('/\n/i','<br>',$datos);
$datos = preg_replace ('/\s/i','&nbsp;',$datos);
$datos_format = "<div id='result_div' style='width: 100%; height: 100%; overflow: scroll; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left'>";
$datos_format .= $datos;
$datos_format .= "</div>";
$data[] = $datos_format;
}
}
}

View File

@ -3853,12 +3853,17 @@ function ui_print_module_string_value($value, $id_agente_module,
$salida = $value;
}
else {
$value = preg_replace ('/</', '&lt;', $value);
$value = preg_replace ('/>/', '&gt;', $value);
$value = preg_replace ('/\n/i','<br>',$value);
$value = preg_replace ('/\s/i','&nbsp;',$value);
$title_dialog =
modules_get_agentmodule_agent_alias($id_agente_module) .
" / " . $module_name;
$salida = "<div " .
"id='hidden_value_module_" . $id_agente_module . "'
style='display: none;' title='" . $title_dialog . "'>" .
style='display: none; width: 100%; height: 100%; overflow: scroll; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left' title='" . $title_dialog . "'>" .
$value .
"</div>" .
"<span " .

View File

@ -81,17 +81,17 @@ if (empty($last_data)) {
echo '<center><img src="' . $last_data . '" alt="image" style="width:100%"/></center>';
}
else {
$datos = preg_replace ('/</', '&lt;', $datos);
$datos = preg_replace ('/>/', '&gt;', $datos);
$datos = preg_replace ('/\n/i','<br>',$datos);
$datos = preg_replace ('/\s/i','&nbsp;',$datos);
echo "<div id='result_div' style='width: 100%; height: 100%; overflow: scroll; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left'>";
$last_data = preg_replace ('/</', '&lt;', $last_data);
$last_data = preg_replace ('/>/', '&gt;', $last_data);
$last_data = preg_replace ('/\n/i','<br>',$last_data);
$last_data = preg_replace ('/\s/i','&nbsp;',$last_data);
echo "<div id='result_div' style='width: 100%; height: 100%; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left'>";
echo $last_data;
echo "</div>";
?>
<script type="text/javascript">
function getScrollbarWidth() {
var div = $('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div></div>');
var div = $('<div style=""></div>');
$('body').append(div);
var w1 = $('div', div).innerWidth();
div.css('overflow-y', 'auto');