Syndication and weird chars
#1
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
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply
#2
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 ?
Reply
#3
You can have an example with https://forum.eggdrop.fr/syndication2.ph...0&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...0&limit=15
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply
#4
Your file seems to be removing é, I think there should be a better approach even if it is more complicate.
Reply
#5
Oh, you're right, I didn't notice that. The printable table is really small, I'll look into another way
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)