fix cross-site scripting vulnerability

This commit is contained in:
alejandro-campos 2020-04-14 12:50:19 +02:00
parent 987d8f4c75
commit 268e317ca3
1 changed files with 1 additions and 11 deletions

View File

@ -127,17 +127,7 @@ if ($read_message) {
).' '.$user_name;
}
$order = [
"\r\n",
"\n",
"\r",
];
$replace = '<br />';
$parsed_message = str_replace(
$order,
$replace,
trim(io_safe_output($row['message']))
);
$parsed_message = nl2br(htmlspecialchars(trim(io_safe_output($row['message']))));
echo '<div class="container">';
echo ' <p>'.$parsed_message.'</p>';