empty "guest pages" after moving from latin1 to utf8

Started by FfdG, June 03, 2022, 01:19:17 PM

Previous topic - Next topic

FfdG

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, ...

Doug Heffernan

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

FfdG

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".

Doug Heffernan

What is the status on this @FfdG? Is it solved or are you still requiring assistence?

Advertisement: