Fixed php8 deprecation for htmlspecialchars (#fixes 266)

This commit is contained in:
Dirk Bauer 2022-06-27 14:58:58 +02:00 committed by Andrew Ruthven
parent 6cf8d5f81d
commit b3b2ccc6c0

View File

@ -44,7 +44,9 @@ function clean_get() {
// relies on variables that are easily manipulated by the user. These lines and functions filter all those variables.
if(isset($_POST)) array_walk($_POST, 'filter_post');
$_GET = clean_get();
$_SERVER['REQUEST_URI'] = str_replace("&", "&", htmlspecialchars($_SERVER['REQUEST_URI']));
if (isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = str_replace("&", "&", htmlspecialchars($_SERVER['REQUEST_URI']));
}
if (isset($_SERVER['HTTP_REFERER'])) {
$_SERVER['HTTP_REFERER'] = htmlspecialchars(@$_SERVER['HTTP_REFERER']);
}