Bug in My Little Forum (Bugs)

by danielb987, Wednesday, March 15, 2017, 15:18 (157 days ago)
edited by Auge, Thursday, March 16, 2017, 07:25

Hi,

I have now installed My Little Forum version 2.4.2 and I have found a bug related to Internet Explorer.

In the file index.php at lines 209 to 214 there is an IF-statement that checks if the web browser is Internet Explorer and if not, sends the header 'Cache-Control: public, max-age=300'.

The problem is that Internet Explorer no longer declare itself with the header HTTP_USER_AGENT as "MSIE" but instead as "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko".

See this page on why:
http://stackoverflow.com/questions/5125438/why-do-chrome-and-ie-put-mozilla-5-0-in-the-user-agent...

This results in that Internet Explorer caches the web page and therefore doesn't update the web page as it should. For example, if I go to the admin page and setting for spam protection and then change a setting and click "save" and then returns to the admin menu page and then go back to the page for spam protection settings, the settings has not been changed. If I reload the page, the settings is correct.

I have the same problem when I log out from the forum.

The solution on this problem is to change line 213 in index.php from:

header('Cache-Control: public, max-age=300');

to:

header('Cache-Control: private, no-cache="set-cookie"');

since as far as I know, there is no easy way to detect Internet Explorer. I have run a PHP script with phpinfo() from Internet Explorer and I cannot see any useful PHP variable to detect Internet Explorer.

I have another forum with the forum software phpBB3 and that forum sends the header 'Cache-Control: private, no-cache="set-cookie"' so that seems the best way to handle the problem.

Best regards,
Daniel Bergqvist


Complete thread:

 RSS Feed of thread

powered by my little forum