Skip to content

QuestionHelper's autocomplete mangles multibyte input on backspace #34254

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy