Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: FfdG on June 03, 2022, 01:19:17 PM

Title: empty "guest pages" after moving from latin1 to utf8
Post by: FfdG on June 03, 2022, 01:19:17 PM
Hi,

I converted my SMF 2.0.19 installation from latin1 to utf8. After doing so, guests can't visit the forum anymore. I fiddled a little bit with the sources and had to add two times:
while (ob_get_level()) ob_end_clean();to get it working:

Once in SSI.php:
// Primarily, this is to fix the URLs...
ob_start('ob_sessrewrite');
while (ob_get_level()) ob_end_clean();

and once in Subs.php:
// Start up the session URL fixer.
ob_start('ob_sessrewrite');
ob_start(function ($buffer) {
global $context;
if (!$context['user']['is_guest'])
return $buffer;

return preg_replace_callback('~(<form[^<]+action=login2(.+))</form>~iUs' . (!empty($context['utf8']) ? 'u' : ''), function($m) use ($context) {
$repl = '';

if (strpos($m[0], $context['session_var']) === false)
$repl .= '<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"/>';

return $m[1] . $repl . '</form>';
}, $buffer);
});
while (ob_get_level()) ob_end_clean();

As those are just ugly hacks, has anyone an idea what to fix/check to find the root cause (I tried e.g. disabling gzip compression already)?

Without those lines guests only see white pages (empty with successful http headers). Errors are not shown with increased E_ALL, ...
Title: Re: empty "guest pages" after moving from latin1 to utf8
Post by: Doug Heffernan on June 03, 2022, 01:43:20 PM
Quote from: FfdG on June 03, 2022, 01:19:17 PMWithout those lines guests only see white pages (empty with successful http headers). Errors are not shown with increased E_ALL, ...

What about the server error log, is there anything logged in there? Have a look at this wiki page and double check that you did the utf-8 conversion properly/thoroughly.

https://wiki.simplemachines.org/smf/UTF-8_Readme
Title: Re: empty "guest pages" after moving from latin1 to utf8
Post by: FfdG on June 03, 2022, 02:57:23 PM
It's a hosted site and I have no access to the server logs, SMF has nothing in its logs.

Quotehttps://wiki.simplemachines.org/smf/UTF-8_Readme

I basically followed this one, besides the old language files are still installed as well, I had to manually fix some entries (e.g. board descriptions) and haven't yet done step 10. But I doubt this is related to the "buffering issue".
Title: Re: empty "guest pages" after moving from latin1 to utf8
Post by: Doug Heffernan on July 02, 2022, 10:42:54 AM
What is the status on this @FfdG? Is it solved or are you still requiring assistence?