BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
14.67k stars 1.85k forks source link

Malformed UTF-8 characters after upgrade #4705

Closed fxthomas closed 8 months ago

fxthomas commented 8 months ago

Attempted Debugging

Searched GitHub Issues

Describe the Scenario

Hello,

I realize this might be difficult to reproduce, but I'm hoping for some pointers to where things might go wrong so I can investigate.

I'm having issues after a recent system/Bookstack update in the last month — the problem is that I didn't notice it right away and I now have no idea of what could have changed. I had been running Bookstack just fine since last year with zero issues, and I haven't touched its configuration since the installation.

Basically, this is a new page with some nice UTF-8 characters:

image

This is what happens when saving:

image

This is what happens when clicking "Edit" again:

image

The body text is apparently saved incorrectly in the database (with different values for the HTML and plain text versions!), but the title itself is OK:

MariaDB [bookstack]> select name, html, text from pages order by pages.created_at desc limit 1;
+-----------+-----------------------------------------------------------------------------+--------------------------+
| name      | html                                                                        | text                     |
+-----------+-----------------------------------------------------------------------------+--------------------------+
| Æ Œ ★     | <p id="bkmrk-test-hello-%C3%86">Æ Œ â
</p>
<p id="bkmrk-%C2%A0"></p>      | à ŠâÂ

           |
+-----------+-----------------------------------------------------------------------------+--------------------------+
1 row in set (0.001 sec)

Previous pages that were not modified have correct UTF-8 characters, both in the db and when viewed in the web interface.

Any idea of what's happening and where I could have messed up?

Exact BookStack Version

v23.10.4

Log Content

No response

Hosting Environment

PHP 8.2 on Archlinux, up-to-date at the time of writing MariaDB 11.2.2-MariaDB, utf8mb4_unicode_ci collation / character set

ssddanbrown commented 8 months ago

Hi @fxthomas, Please see my comment here: https://github.com/BookStackApp/BookStack/issues/4701#issuecomment-1835906884

I'm going to close this as a duplicate of #4701, Feel free to comment on that issue if needed.