Remove magic quotes references (deprecated since PHP 5!)

This commit is contained in:
Floorb 2021-07-10 15:37:04 -04:00
parent 5b2e3d5177
commit 6624ffd3cb
3 changed files with 1 additions and 34 deletions

View file

@ -32,9 +32,6 @@ if (!empty($_POST))
if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) )
continue;
if ( get_magic_quotes_gpc() )
$value = htmlspecialchars( stripslashes((string)$value) );
else
$value = htmlspecialchars( (string)$value );
?>
<tr>

View file

@ -137,21 +137,6 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
}
// Escape from quotes
if (get_magic_quotes_gpc()) {
function callback_stripslashes(&$val, $name)
{
if (get_magic_quotes_gpc())
$val = stripslashes($val);
}
if (count($_GET))
array_walk($_GET, 'callback_stripslashes');
if (count($_POST))
array_walk($_POST, 'callback_stripslashes');
if (count($_COOKIE))
array_walk($_COOKIE, 'callback_stripslashes');
}
// Logout
if (isset($_GET['logout'])) {
header('Location: ' . $_SERVER['HTTP_REFERER']);

View file

@ -109,21 +109,6 @@ if (isset($_GET['logout'])) {
session_destroy();
}
// Escape from quotes
if (get_magic_quotes_gpc()) {
function callback_stripslashes(&$val, $name)
{
if (get_magic_quotes_gpc())
$val = stripslashes($val);
}
if (count($_GET))
array_walk($_GET, 'callback_stripslashes');
if (count($_POST))
array_walk($_POST, 'callback_stripslashes');
if (count($_COOKIE))
array_walk($_COOKIE, 'callback_stripslashes');
}
// Page views
$site_view_rows = $conn->query("SELECT @last_id := MAX(id) FROM page_view");
while ($row = $site_view_rows->fetch()) {