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

SCSS converter: expand @config["source"] to be "safer". #55

Merged
merged 1 commit into from
Nov 14, 2016

Conversation

parkr
Copy link
Member

@parkr parkr commented Nov 14, 2016

Addresses a potential issue from #50.

/cc @jekyll/gh-pages


private
def site_source
@site_source ||= File.expand_path(@config["source"]).freeze

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's being passed to Jekyll.sanitized_path in 2/3 places is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Jekyll.sanitized_path does not expand the base directory, so we have to do that here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jekyll.sanitized_path does not expand the base directory, so we have to do that here.

Would the smarter fix be to do that there?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the one hand, that would mean you can pass any directory and it'll auto-expand, on the other File.expand_path calls are pretty expensive and we use this function a lot.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd also lock us to a particular Jekyll version.

@parkr parkr added the security label Nov 14, 2016
end

# Expand file globs (e.g. `node_modules/*/node_modules` )
Dir.chdir(@config["source"]) do
Dir.chdir(site_source) do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need Jekyll.sanitized_path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe so – Jekyll.sanitized_path just ensures the first argument is a prefix for the second argument, so we wouldn't be saving anything there.

@parkr
Copy link
Member Author

parkr commented Nov 14, 2016

@jekyllbot: merge +bug

@jekyllbot jekyllbot merged commit aad0f5b into master Nov 14, 2016
@jekyllbot jekyllbot deleted the expand_source branch November 14, 2016 21:15
jekyllbot added a commit that referenced this pull request Nov 14, 2016
parkr added a commit that referenced this pull request Nov 14, 2016


* 'master' of https://github.com/jekyll/jekyll-sass-converter:
  Update history to reflect merge of #55 [ci skip]
  Ok fine, Jekyll 2.
  Clean up our test matrix.
  Get our scripts in order.
  SCSS converter: expand @config["source"] to be "safer".
@jekyll jekyll locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants