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

Throw an error if includes or data directory is outside of Eleventy’s working directory #421

Closed
wants to merge 2 commits into from
Closed

Throw an error if includes or data directory is outside of Eleventy’s working directory #421

wants to merge 2 commits into from

Conversation

kleinfreund
Copy link
Contributor

@kleinfreund kleinfreund commented Feb 16, 2019

This pull request is the first step for #368.

  • Makes TemplateConfig throw an error on construction if either the includes or data directories point outside of Eleventy’s working directory.

  • There is also some unrelated clean up in the first commit:

    The TemplateWriter class no longer creates its EleventyFiles object itself when it is missing. This was only there to ensure that the EleventyFiles object is set during testing. Setting it is now a responsibility of the tests itself.

What do you think about the error message or error handling in general?

Note: Since there might be users who rely on the current functionality, this is a breaking change.

@kleinfreund kleinfreund changed the title Restrict eleventy paths Throw an error if includes or data directory is outside of Eleventy’s working directory Feb 16, 2019
@kleinfreund
Copy link
Contributor Author

If this looks good to you, I can do the same for the input and output directories.

@kleinfreund
Copy link
Contributor Author

I resolved the conflicts with the latest changes in the main branch; hence, the changes needed to be force-pushed again after rebasing.

@d2s
Copy link
Contributor

d2s commented Mar 11, 2019

Good work with the initial concept. This kind of improvements increase my trust in the future of Eleventy. 👍

@zachleat zachleat added this to the Next Major Version milestone Apr 19, 2019
@zachleat zachleat added the breaking-change This will have to be included with a major version as it breaks backwards compatibility. label Apr 19, 2019
@kleinfreund
Copy link
Contributor Author

I modified the first commit in the following way:

The TemplateWriter class no longer creates its EleventyFiles object itself when it is missing. This was only there to ensure that the EleventyFiles object is set during testing. Setting it is now a responsibility of the tests itself.

I’ll update the original PR message.

@zachleat zachleat added this to Needs triage in Eleventy 1.0 Feb 29, 2020
@zachleat zachleat modified the milestones: Planning for Eleventy v1.0.0, Eleventy 1.0.0 Nov 22, 2020
@zachleat zachleat removed this from Needs triage in Eleventy 1.0 Jul 13, 2021
@zachleat zachleat removed this from the Eleventy 1.0.0 milestone Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This will have to be included with a major version as it breaks backwards compatibility.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants