emoji in forms rise a database error

Open
#280 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
php, symfony
Domain
backend, databases

Research direction

No file or test is named. Start by tracing how BoltForms persists submitted form values and how the database charset is configured, then reproduce an emoji submission against the default setup. Done means emoji in names or messages no longer causes a fatal database error and the submitted text is handled as intended.

Written by the indexing model from the issue text.

Description

If you choose to save form submissions to the database and the user puts some emoji in their name or message, it leads to a fatal error "incorrect string value ... for column". Changing the table's charset to utf8mb4 doesn't help, apparently, it requires the whole database's charset to be set to that. But Bolt's default charset is regular utf8. If Bolt team is not going to change their charset to that (I suppose they're not), then BoltForms must sanitize input. I had to make an extension that uses the regex from there: https://stackoverflow.com/a/35961386/2418445. But you should consider including this by default.

Dominant language
PHP
Stars
52
Forks
54
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bolt/boltforms

All issues in bolt/boltforms

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.