You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Input any utf-8 string in autocomplete input
Tap backspace
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
The text was updated successfully, but these errors were encountered:
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] Fix autocomplete multibyte input support
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #34254
| License | MIT
| Doc PR | -
Added it just where it's needed.
Commits
-------
a1129f9 [Console] Fix autocomplete multibyte input support
Symfony version(s) affected: 4.3.3
Description
Due to usage of
substr
in place ofmb_substr
in backspace portion ofQuestionHelper::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
Possible Solution
Quick fix that helped me was to replace
substr
withmb_substr
in backspace handling portion ofQuestionHelper::autocomplete
The text was updated successfully, but these errors were encountered: