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

dijit/form/_FormSelectWidget:getOptions breaks without CSP unsafe-eval #188

Open
jwadamson opened this issue Mar 4, 2021 · 0 comments
Open

Comments

@jwadamson
Copy link
Contributor

The getOptions function in 1.16.3 contains the following snippet:

			if(lang.isArrayLike(valueOrIdx)){
				return array.map(valueOrIdx, "return this.getOptions(item);", this); // __SelectOption[]
			}

By providing a string for the callback value, the array module then attempts to create a Function from the string. This fails when unsafe-eval is not allowed by the content-security-policy and could be rewritten to pass a function instead of a string e.g.

return array.map(valueOrIdx, (item) => this.getOptions(item), this); // __SelectOption[]
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