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
{{ message }}
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
A bug in handling input from the user in the search makes "weird" unicode characters to appear.
Steps to reproduce
There are two methods of triggering this bug that I know of
Method 1 (works in multiple choice and single choice)
Click on the select (you now should be able to type & the dropdown appears)
Press Return (the first option should be selected)
Type Uppercase "E" by holding Shift + E
A "�" character appears in the input.
Method 2
Click on the select (you now should be able to type & the dropdown appears)
Hold Ctrl and click on the input again, release Ctrl after click
A "�" character appears in the input.
Code description & solution
The bug is triggered in the mainClick() method. Every keyCode of every event that goes into this method gets converted to a string by String.fromCharCode() and put into the input, without verification.
Some keyup and keydown events, such as arrows, key-combos and special non-printable characters can be there as well. Fortunatelly, KeyboardEvent class contains a .charCode, that when used on onkeydown or onkeyup events returns "0".
A bug in handling input from the user in the search makes "weird" unicode characters to appear.
Steps to reproduce
There are two methods of triggering this bug that I know of
Method 1 (works in multiple choice and single choice)
Shift
+E
A "�" character appears in the input.
Method 2
Ctrl
and click on the input again, releaseCtrl
after clickA "�" character appears in the input.
Code description & solution
The bug is triggered in the
mainClick()
method. EverykeyCode
of every event that goes into this method gets converted to a string byString.fromCharCode()
and put into the input, without verification.Some keyup and keydown events, such as arrows, key-combos and special non-printable characters can be there as well. Fortunatelly,
KeyboardEvent
class contains a.charCode
, that when used on onkeydown or onkeyup events returns "0".I've opened up a PR that fixes this issue: #15
The text was updated successfully, but these errors were encountered: