fix Creation of dynamic property is deprecated

This commit is contained in:
towards-a-new-leftypol 2023-12-07 02:46:49 +00:00
parent 291072dfd2
commit 6808f65ef7
2 changed files with 48 additions and 5 deletions

View File

@ -332,14 +332,54 @@ function embed_html($link) {
return 'Embedding error.'; return 'Embedding error.';
} }
class Post { class PostProps {
public $id;
public $thread;
public $subject;
public $email;
public $name;
public $trip;
public $capcode;
public $body;
public $body_nomarkup;
public $time;
public $bump;
public $files;
public $num_files;
public $filehash;
public $password;
public $ip;
public $sticky;
public $locked;
public $cycle;
public $sage;
public $embed;
public $slug;
public $delete_token;
public $board;
public $mod;
public $root;
public $hr;
public $posts;
public $omitted;
public $omitted_images;
public $modifiers;
public $images;
public $replies;
}
class Post extends PostProps {
public function __construct($post, $root=null, $mod=false) { public function __construct($post, $root=null, $mod=false) {
global $config; global $config;
if (!isset($root)) if (!isset($root))
$root = &$config['root']; $root = &$config['root'];
foreach ($post as $key => $value) { foreach ($post as $key => $value) {
$this->{$key} = $value; $this->$key = $value;
} }
if (isset($this->files) && $this->files) if (isset($this->files) && $this->files)
@ -382,14 +422,15 @@ class Post {
} }
}; };
class Thread { class Thread extends PostProps {
public function __construct($post, $root = null, $mod = false, $hr = true) { public function __construct($post, $root = null, $mod = false, $hr = true) {
global $config; global $config;
if (!isset($root)) if (!isset($root))
$root = &$config['root']; $root = &$config['root'];
foreach ($post as $key => $value) { foreach ($post as $key => $value) {
$this->{$key} = $value; $this->$key = $value;
} }
if (isset($this->files)) if (isset($this->files))

View File

@ -2029,6 +2029,7 @@ function mod_warning_post($board,$post, $token = false) {
} }
} }
} }
if(isset($_POST['thread'])) { if(isset($_POST['thread'])) {
// Redirect to thread // Redirect to thread
header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . str_replace('%d', $_POST['thread'], $config['file_page']), true, $config['redirect_http']); header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . str_replace('%d', $_POST['thread'], $config['file_page']), true, $config['redirect_http']);
@ -2037,6 +2038,7 @@ function mod_warning_post($board,$post, $token = false) {
header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']);
} }
} }
$args = array( $args = array(
'ip' => $ip, 'ip' => $ip,
'hide_ip' => !hasPermission($config['mod']['show_ip'], $board), 'hide_ip' => !hasPermission($config['mod']['show_ip'], $board),