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

Sanitize Input in New Chat Dialog #3299

Closed
xeruf opened this issue Jul 11, 2023 · 1 comment · Fixed by #3300
Closed

Sanitize Input in New Chat Dialog #3299

xeruf opened this issue Jul 11, 2023 · 1 comment · Fixed by #3300

Comments

@xeruf
Copy link

xeruf commented Jul 11, 2023

  • Operating System (Linux/Mac/Windows/iOS/Android): Arch
  • Delta Chat Version: Latest
  • Expected behavior: When I copy-paste an e-mail address into the "New Chat" dialog, it is accepted.
  • Actual behavior: Sometimes the copy-paste adds an extra space, which trips Delta up.

Loosely related to #3286 and #1450

@link2xt
Copy link
Collaborator

link2xt commented Jul 11, 2023

We could also .trim() whitespace in the core, both dc_may_be_valid_addr and dc_create_contact, but it looks more correct to do on the caller side, otherwise it would be to easy for bots using this APIs to not notice that they have whitespace in their databases from loosely parsed CSVs or something like this.

Simon-Laux added a commit that referenced this issue Jul 17, 2023
* trim the input value to fix #3299

* update change log to include fix of #3299

* per simon's suggestion

* Update CHANGELOG.md

Co-authored-by: Simon Laux <Simon-Laux@users.noreply.github.com>

* change the useContactNew hook to trim the queryStr

* happy now, prettier?

* trim queryStr in useContactsNew in every case

* per simon's review

---------

Co-authored-by: Simon Laux <Simon-Laux@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

2 participants