Jump to content

Logout while saving page with emoji in fields


Zeka
 Share

Recommended Posts

Hi.

I get logged out when I try to save a page which contains emojis like ?, but fields are saved. Then when I try to log in back on the same URL I get 'This request was aborted because it appears to be forged.' I tested it on several setups. Could somebody confirm the issue? 

Setup:

PW 3.0.148
InnoDB
utf8mb4_general_ci

 

Link to comment
Share on other sites

You could check in first instance the mysql server settings and adjust them in the config file my.cnf :

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
character-set-client-handshake = FALSE

Then restart the server and try to save a page with an emoji.

Link to comment
Share on other sites

6 minutes ago, dragan said:

I always choose utf8_general_ci.

For storing emoji, utf8mb4 is required as each emoji consist of four bytes in UTF-8 and you cannot store them using MySQL utf8 implementation as it can only symbols that consist of one to three bytes.

Edited by flydev ??
precisions
Link to comment
Share on other sites

  • 1 year later...

Hey @Zeka, did you ever solve this? I’m seeing the same problem now, after switching to PHP 8. The page is saved successfully, but PW logs me out in the next request (the redirect after POST). Only happens when emoji are present.

Edit: Did you run Tracy Debugger by any chance? For me it seems to happen only when Tracy is enabled.

Link to comment
Share on other sites

Thanks for the quick response! Yeah, everything is set to utf8mb4, gotta have my emoji ???

I’m also using InnoDB, btw, but I feel like if it were a database issue I would either see corrupted data or an actual error in the logs.

Anyway, I’m leaning towards this being some sort of exotic Tracy/PHP 8/mb4 bug. Guess I’ll try going back to PHP 7 to confirm that suspicion and see if I can narrow it down somehow. Unless in your case Tracy and PHP 8 weren’t involved?

In the end it doesn’t trouble me too much, because non-superusers seem unaffected…

Link to comment
Share on other sites

9 minutes ago, Jan Romero said:

Thanks for the quick response! Yeah, everything is set to utf8mb4, gotta have my emoji ???

I’m also using InnoDB, btw, but I feel like if it were a database issue I would either see corrupted data or an actual error in the logs.

Anyway, I’m leaning towards this being some sort of exotic Tracy/PHP 8/mb4 bug. Guess I’ll try going back to PHP 7 to confirm that suspicion and see if I can narrow it down somehow. Unless in your case Tracy and PHP 8 weren’t involved?

In the end it doesn’t trouble me too much, because non-superusers seem unaffected…

it definitely was php7... something

  • Like 1
Link to comment
Share on other sites

Sorry to unearth this thread again, but I must apologise. It was indeed a collation thing. I had only checked the relevant field tables, but after switching everything except field_password to mb4, the problem disappeared. The issue must have started when my hoster migrated from MySQL to MariaDB months ago, because I’m sure I originally installed PW with mb4, but apparently I didn’t notice until after switching to PHP 8 recently. Probably because earlier I didn’t run Tracy constantly. Not sure how exactly it was implicated, but it was entirely my fault anyway ? Just wish I had had some hints in the logs. Eventually I got an SQL collation exception when purposely searching for an emoji in the Admin, but never with the random logouts. Anyway, glad to have this thread!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...