Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Error in /ban-appeals #14

Open
perdedora opened this issue Dec 31, 2021 · 3 comments
Open

PHP Error in /ban-appeals #14

perdedora opened this issue Dec 31, 2021 · 3 comments

Comments

@perdedora
Copy link

perdedora commented Dec 31, 2021

When trying to access ban-appeals with the config:

$config['ban_appeals'] = true;
$config['ban_show_post'] = true;

I get the following error message:

Caught fatal error: Uncaught TypeError: json_decode(): Argument # 1 ($json) must be of type string, array given in /var/www/Tinyboard/inc/display.php:365Stack trace:# 0 /var/www/Tinyboard/inc/display.php(365): json_decode()# 1 /var/www/Tinyboard/inc/mod/pages.php(1020): Thread->__construct()# 2 /var/www/Tinyboard/mod.php(195): mod_ban_appeals()# 3 {main} thrown in /var/www/Tinyboard/inc/display.php on line 365

Edit: this is with php8.0

@perdedora
Copy link
Author

Update: this does not happen on php7.4

@perdedora
Copy link
Author

I think this has to do it with recent changes in @ operator.
From php 8.0 changelog:

The @ operator no longer silences fatal errors.

@perdedora
Copy link
Author

This can be solved with:

if (isset($this->files) && $this->files)
			$this->files = is_string($this->files) ? json_decode($this->files) : $this->files;

in

$this->files = @json_decode($this->files);
and
$this->files = @json_decode($this->files);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant