Avoid print <> symbols as html tags in snapshot viewer

This commit is contained in:
fbsanchez 2016-11-22 14:56:54 +01:00
parent 596ad9dd2f
commit a3b7eac666
1 changed files with 3 additions and 1 deletions

View File

@ -72,8 +72,10 @@ $label = get_parameter ("label");
echo '<img src="' . $datos . '" alt="image"/>';
}
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);
$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'>";
echo $datos;
echo "</div>";