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

"include" broken by v2.5.4 with two-arg invocation #221

Closed
rpaterson opened this issue Dec 5, 2016 · 6 comments
Closed

"include" broken by v2.5.4 with two-arg invocation #221

rpaterson opened this issue Dec 5, 2016 · 6 comments

Comments

@rpaterson
Copy link
Contributor

The latest release v2.5.4 throws an error when using "include" if "render" was called with two arguments instead of three (context mixed with options).

@rpaterson
Copy link
Contributor Author

Here's the offending commit: 3a534a9

@RyanZim
Copy link
Collaborator

RyanZim commented Dec 5, 2016

I think this was on purpose, context mixed with options is a bad practice, and highly discouraged.

@rpaterson
Copy link
Contributor Author

The README says: It is also possible to use ejs.render(dataAndOptions); where you pass everything in a single object. In that case, you'll end up with local variables for all the passed options. However, be aware that your code could break if we add an option with the same name as one of your data object's properties.

It goes on to say that it's not recommended, but I think it's still supported.

@mde
Copy link
Owner

mde commented Dec 6, 2016

This is still supported in principle, but securing it may mean in practice we have to remove some specific options. Having said that, this particular case looks fixable. If we find other practical problems with these security fixes, we'll start documenting unsupported options. Thanks for your patience with this.

@mde
Copy link
Owner

mde commented Dec 6, 2016

@mde mde closed this as completed Dec 6, 2016
@rpaterson
Copy link
Contributor Author

Thanks!

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

3 participants