mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +01:00
Remove magic quotes references (deprecated since PHP 5!)
This commit is contained in:
parent
5b2e3d5177
commit
6624ffd3cb
3 changed files with 1 additions and 34 deletions
|
@ -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>
|
||||
|
|
15
index.php
15
index.php
|
@ -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']);
|
||||
|
|
15
paste.php
15
paste.php
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue