PHP8: Fix posting

This commit is contained in:
towards-a-new-leftypol 2023-09-05 14:25:27 -04:00
parent 4162d94f15
commit 1302dcab74
2 changed files with 17 additions and 13 deletions

9
.gitignore vendored
View File

@ -71,9 +71,15 @@ stylesheets/fonts
#Images from twemoji #Images from twemoji
js/twemoji/16x16/ js/twemoji/16x16/
<<<<<<< HEAD
# JUNK # JUNK
GET/ GET/
.bash_history
.cache/
777/
R9K/
WRK/
a/
alt/
anime/ anime/
b/ b/
b_anime/ b_anime/
@ -106,3 +112,4 @@ save_ass_thread/
sfw/ sfw/
tech/ tech/
ref/ ref/
ga/

View File

@ -7,17 +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);
}
$dropped_post = false; $dropped_post = false;
function handle_nntpchan() { function handle_nntpchan() {
@ -1411,8 +1400,16 @@ function handle_post(){
$js = (object) array(); $js = (object) array();
// Tell it to delete the cached post for referer // Tell it to delete the cached post for referer
$js->{$_SERVER['HTTP_REFERER']} = true; $js->{$_SERVER['HTTP_REFERER']} = true;
// Encode and set cookie // Encode and set cookie
setcookie($config['cookies']['js'], json_encode($js), 0, $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, false, false); setcookie(
$config['cookies']['js'],
json_encode($js),
0,
$config['cookies']['jail'] ? $config['cookies']['path'] : '/',
'',
false,
false);
} }
$root = $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root']; $root = $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'];