MyBB Community Forums

Full Version: PHP Warnings Display On Index
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Right, so the problem is even when errors are disabled in php.ini and when error handling is off I am getting errors that display in my index page as you probably know it's not good to let everyone see your PHP warnings and even what version I use.

Can anyone help me figure out how to hide them I'm not worried about the errors I can fix those I just don't want everyone to see them
What errors you are receiving?
A snapshot / link?
oh sorry I attached a ss guess it did not upload
https://i.gyazo.com/5535c321d59465cd8312...581280.png

And like I said its not the errors im worried about its the fact that they are public
This problem is not in MyBB Core.
You are using a plugin which has a file called serversboard.php and the code in it is incompatible with the PHP version you are using (7.2.2)

Disable that plugin and it will all go good.
You can then further fix the plugin and reactivate.
Odd it worked just fine for a few months but how do I stop plugins from showing warnings on the forum page or is the plugin itself pushing the warning?if so is there a way to set it so that only admins can see any warnings from any plugin?
If you set the PHP version to recommended / latest in hosting panel and if they update / set a later version as default this can happen.

I assume you are using this plugin:
https://community.mybb.com/mods.php?action=view&pid=117

I don't know what it does but found some weird unnecessary declarations in file which are meaningless. Anyway, you can open this file:
inc/plugins/serversboard.php
and go to line 1146, find:
					$data['gq_numplayers'] = $data['gq_numplayers'];
					$data['gq_maxplayers'] = $data['gq_maxplayers'];

and change to:

					$data['gq_numplayers'] = $data['gq_numplayers'] ? $data['gq_numplayers'] : 1;
					$data['gq_maxplayers'] = $data['gq_maxplayers'] ? $data['gq_maxplayers'] : 1;

Save the file, reupload, reactivate plugin and see what happens ...

(thread moved)
ah thank you this fixed the issue but how do I make sure guests do not see warning messages from plugins in the future? I would rather errors go to a log file as I don't want anyone to see information they could use to hack us.

hmm also I get an error in this plugin for line 1723 as well on a different page

$data['gq_procents'] = round($data['gq_numplayers'] / $data['gq_maxplayers'] * 100)." %";

oh and also its self hosted so I have back end lol