Confirmed tagify username autocomplete fails to populate as expected

Xon

Well-known member
Licensed customer
Affected version
2.3.11
If a username has ` (and probably some other characters) then a tagify autocomplete renders it as ' and then fails to insert it into the tagify field.

This is because the tagify suggestedListItems has the the ` character but the html value containts the ' character.
 
Last edited:
The problem is this method inside tagify;

Code:
export function escapeHTML( s ){
    return typeof s == 'string' ? s
        .replace(/&/g, "&")
        .replace(/</g, "&lt;")
        .replace(/>/g, "&gt;")
        .replace(/"/g, "&quot;")
        .replace(/`|'/g, "&#039;")
        : s;
}

It escapes ` and ' as the same which is obviously wrong. Also this is a horrible way to escape html for rendering
 
escapeHTML is called in tag/ dropdownItem /getAttributes, so simply not using this.tagify.settings.dropdown.escapeHTML doesn't work. It also is applied when a tag is added :(
 
Last edited:
Back
Top Bottom