MyBB Community Forums

Full Version: Compression on Mod CP prevents loading the page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After upgrading from MyBB 1.6 to 1.8.6 I've started getting issues with the moderator control panel. When GZip compression is enabled (Regardless of compression level), the panel fails to load with the error "ERR_CONTENT_DECODING_FAILED". Turning off compression makes the panel work as expected, but I want it enabled as it more than halves page loading speeds on my forum.

I tried disabling my plugins one by one, but none of them seems to have caused the issue. I also went through all of my templates checking the diff report. Most of my changes to the mod templates were minor, so I just reverted them and did the change again.

You don't have to be logged in to see the error. You can see it here:
https://shellsec.pw/modcp.php

[Image: lh1BGJ.png]
Is GZip compression already enabled at the server level? Usually that's the case when this happens, if I'm not mistaken.
Please check everything here: http://stackoverflow.com/questions/14039...ing-failed

I've no idea why modcp would be the only affected script, except the UTF-8 encoding with BOM issue mentioned in the link above.
(2015-12-25, 10:33 PM)Josh H. Wrote: [ -> ]Is GZip compression already enabled at the server level? Usually that's the case when this happens, if I'm not mistaken.

Yes, but turning it off and restarting nginx didn't help.

(2015-12-25, 10:53 PM)Destroy666 Wrote: [ -> ]Please check everything here: http://stackoverflow.com/questions/14039...ing-failed

I've no idea why modcp would be the only affected script, except the UTF-8 encoding with BOM issue mentioned in the link above.

There's no byte order mark in modcp.php. Just to be sure I ran this:
awk '{if(NR==1)sub(/^\xef\xbb\xbf/,"");print}' modcp.php > modcp2.php; mv modcp2.php modcp.php

I also tried enabling zlib.output_compression but it messed everything up.



I realize that I probably don't need this issue solved anymore, now that I remember that I can just up the compression level in nginx. It's still a bit weird, though.
BOM may also be a part of any included file e.g modcp functions: https://github.com/mybb/mybb/blob/featur..._modcp.php
That file doesn't seem to have one either. I can't think of other files that might be included in modcp.
require_once "./global.php";
require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/functions_upload.php";
require_once MYBB_ROOT."inc/functions_modcp.php";
require_once MYBB_ROOT."inc/class_parser.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/class_moderation.php";
require_once MYBB_ROOT."inc/datahandlers/user.php";
require_once MYBB_ROOT."inc/functions_warnings.php";

... don't think, but search Toungue
(2015-12-26, 12:53 AM)Nik101010 Wrote: [ -> ]require_once "./global.php";
require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/functions_upload.php";
require_once MYBB_ROOT."inc/functions_modcp.php";
require_once MYBB_ROOT."inc/class_parser.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/class_moderation.php";
require_once MYBB_ROOT."inc/datahandlers/user.php";
require_once MYBB_ROOT."inc/functions_warnings.php";

... don't think, but search Toungue

Just checked every single file in the installation. None of them have a BOM.