Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Incorrect string value for Page account when inserting Emoji #980

Open
q2apro opened this issue Feb 23, 2023 · 0 comments
Open

Bug: Incorrect string value for Page account when inserting Emoji #980

q2apro opened this issue Feb 23, 2023 · 0 comments

Comments

@q2apro
Copy link

q2apro commented Feb 23, 2023

Replicate Bug:

  1. Edit your account
  2. Insert "Test 👍" into the Name field
  3. Save

Result:

PHP Question2Answer MySQL query error 1366: Incorrect string value: '\xF0\x9F\x91\x8D' for column 'content' at row 1 - Query: INSERT INTO qa_userprofile (userid, title, content) VALUES ('1', 'name', 'Test 👍') ON DUPLICATE KEY UPDATE content = VALUES(content)

Solution:

Probably we could clean the value in "qa-include/db/users.php":

function qa_db_user_profile_set($userid, $field, $value)

adding simply:

$value = qa_remove_utf8mb4($value);

Other solution:

The DB fields content and title are utf8mb3_general_ci. They could be altered to utf8mb4_general_ci to accept emojis. But probably for now the PHP solution is preferable.

@q2apro q2apro changed the title Bug: Page account, insert Emoji Bug: Incorrect string value for Page account when inserting Emoji Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant