Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional logic doesn’t work well with radio fields containing special characters #18

Open
jeanfredrik opened this issue May 13, 2020 · 0 comments

Comments

@jeanfredrik
Copy link

If you create a radio field with label or values containing characters other than A–Z and 0–9 there’s a risk they will get mixed up because å, ä, ö and such characters are removed in the conditional logic, namely in this part of the admin JS code:

Conditional.prototype.conditionalString = function(string) {
string = string.toLowerCase();
string = string.replace(/\s+/g, '_');
string = string.replace(/[^a-z0-9_]+/ig, '');
string = string.replace(/_+$/, '');
return string;
};

This means that the editor needs to be careful not to create fields with labels or values that can get mixed up. It would be better if something matching Wordpress’ sanitize_title was used for the labels or that both labels and values are used as-is (or escaped) so that no information is lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant