Thanks to visit codestin.com
Credit goes to github.com

Skip to content

QuestionHelper's autocomplete mangles multibyte input on backspace #34254

Closed
@dotterian

Description

@dotterian

Symfony version(s) affected: 4.3.3

Description
Due to usage of substr in place of mb_substr in backspace portion of QuestionHelper::autocomplete it remove only one byte from the end of utf-8 strings instead of two, resulting in mangled input and possible errors.

Maybe there are reasons not to use mb_substr?

How to reproduce

  1. Input any utf-8 string in autocomplete input
  2. Tap backspace
  3. Now your input string is damaged beyond recognition

Possible Solution
Quick fix that helped me was to replace substr with mb_substr in backspace handling portion of QuestionHelper::autocomplete

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions