MyBB Community Forums
Syndication and weird chars - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+---- Thread: Syndication and weird chars (/thread-233814.html)



Syndication and weird chars - Crazycat - 2021-10-06

Hi there,

I manage a technical forum where often my users post scripts or snippets, and they sometime contain weird characters (control code).
No trouble with the forum itself but it brokes the syndication feed with some readers.

So, the solution I found was to remove non-printable chars from the message:
syndication.php#L228

Modified line:
$items[$post['tid']]['description'] = preg_replace('/[[:^print:]]/', '', $parsed_message);

PR #4462


RE: Syndication and weird chars - Omar G. - 2021-10-14

The solution you pushed seems unpractical. Surely there should be a more optimal approach.

Could you share some example here so we can test with it ?

Also, which browsers or services seem to be break ?


RE: Syndication and weird chars - Crazycat - 2021-10-14

You can have an example with https://forum.eggdrop.fr/syndication2.php?fid=4,20&limit=15, using firefox or chrome.

Error displayed with Chrome: This page contains the following errors: error on line 298 at column 26: Input is not proper UTF-8, indicate encoding ! Bytes: 0x03 0x30 0x34 0x26

My modified syndication.php gives correct result: https://forum.eggdrop.fr/syndication.php?fid=4,20&limit=15


RE: Syndication and weird chars - Omar G. - 2021-10-15

Your file seems to be removing é, I think there should be a better approach even if it is more complicate.


RE: Syndication and weird chars - Crazycat - 2021-10-15

Oh, you're right, I didn't notice that. The printable table is really small, I'll look into another way