mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
remove magic_quotes check; it`s 2016 after all
This commit is contained in:
parent
4c827cf105
commit
19b70663d7
10
mod.php
10
mod.php
@ -12,16 +12,6 @@ require_once 'inc/mod/auth.php';
|
|||||||
if ($config['debug'])
|
if ($config['debug'])
|
||||||
$parse_start_time = microtime(true);
|
$parse_start_time = microtime(true);
|
||||||
|
|
||||||
// Fix for magic quotes
|
|
||||||
if (get_magic_quotes_gpc()) {
|
|
||||||
function strip_array($var) {
|
|
||||||
return is_array($var) ? array_map('strip_array', $var) : stripslashes($var);
|
|
||||||
}
|
|
||||||
|
|
||||||
$_GET = strip_array($_GET);
|
|
||||||
$_POST = strip_array($_POST);
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = isset($_SERVER['QUERY_STRING']) ? rawurldecode($_SERVER['QUERY_STRING']) : '';
|
$query = isset($_SERVER['QUERY_STRING']) ? rawurldecode($_SERVER['QUERY_STRING']) : '';
|
||||||
|
|
||||||
$pages = array(
|
$pages = array(
|
||||||
|
12
post.php
12
post.php
@ -7,16 +7,6 @@ require_once 'inc/functions.php';
|
|||||||
require_once 'inc/anti-bot.php';
|
require_once 'inc/anti-bot.php';
|
||||||
require_once 'inc/bans.php';
|
require_once 'inc/bans.php';
|
||||||
|
|
||||||
// Fix for magic quotes
|
|
||||||
if (get_magic_quotes_gpc()) {
|
|
||||||
function strip_array($var) {
|
|
||||||
return is_array($var) ? array_map('strip_array', $var) : stripslashes($var);
|
|
||||||
}
|
|
||||||
|
|
||||||
$_GET = strip_array($_GET);
|
|
||||||
$_POST = strip_array($_POST);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((!isset($_POST['mod']) || !$_POST['mod']) && $config['board_locked']) {
|
if ((!isset($_POST['mod']) || !$_POST['mod']) && $config['board_locked']) {
|
||||||
error("Board is locked");
|
error("Board is locked");
|
||||||
}
|
}
|
||||||
@ -447,7 +437,7 @@ if (isset($_POST['delete'])) {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($_FILES as $key => $file) {
|
foreach ($_FILES as $key => $file) {
|
||||||
if ($file['size'] && $file['tmp_name']) {
|
if ($file['size'] && $file['tmp_name']) {
|
||||||
$file['filename'] = urldecode(get_magic_quotes_gpc() ? stripslashes($file['name']) : $file['name']);
|
$file['filename'] = urldecode($file['name']);
|
||||||
$file['extension'] = strtolower(mb_substr($file['filename'], mb_strrpos($file['filename'], '.') + 1));
|
$file['extension'] = strtolower(mb_substr($file['filename'], mb_strrpos($file['filename'], '.') + 1));
|
||||||
if (isset($config['filename_func']))
|
if (isset($config['filename_func']))
|
||||||
$file['file_id'] = $config['filename_func']($file);
|
$file['file_id'] = $config['filename_func']($file);
|
||||||
|
Loading…
Reference in New Issue
Block a user