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,10 +32,7 @@ if (!empty($_POST))
if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) )
continue; continue;
if ( get_magic_quotes_gpc() ) $value = htmlspecialchars( (string)$value );
$value = htmlspecialchars( stripslashes((string)$value) );
else
$value = htmlspecialchars( (string)$value );
?> ?>
<tr> <tr>
<th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th>

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 // Logout
if (isset($_GET['logout'])) { if (isset($_GET['logout'])) {
header('Location: ' . $_SERVER['HTTP_REFERER']); header('Location: ' . $_SERVER['HTTP_REFERER']);

View file

@ -109,21 +109,6 @@ if (isset($_GET['logout'])) {
session_destroy(); 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 // Page views
$site_view_rows = $conn->query("SELECT @last_id := MAX(id) FROM page_view"); $site_view_rows = $conn->query("SELECT @last_id := MAX(id) FROM page_view");
while ($row = $site_view_rows->fetch()) { while ($row = $site_view_rows->fetch()) {