Skip to content

Commit 02dc125

Browse files
committed
* '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".
2 parents 57aee26 + 61a8acb commit 02dc125

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

.travis.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@ language: ruby
33
rvm:
44
- 2.2.4
55
- 2.1.8
6-
- ruby-head
76
matrix:
8-
allow_failures:
9-
- rvm: ruby-head
107
include:
11-
- rvm: 1.9.3
12-
env: JEKYLL_VERSION=2.5
13-
- rvm: 2.3.0
14-
env: JEKYLL_VERSION=3.1
8+
- rvm: 2.3.1
9+
env: JEKYLL_VERSION=3.3
1510
env:
1611
matrix:
1712
- JEKYLL_VERSION=2.5
18-
- JEKYLL_VERSION=3.1
13+
- JEKYLL_VERSION=3.3
1914
branches:
2015
only:
2116
- master

History.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
* Allow load_paths in safe mode with sanitization (#50)
99

10+
### Bug Fixes
11+
12+
* SCSS converter: expand @config["source"] to be "safer". (#55)
13+
1014
## 1.4.0 / 2015-12-25
1115

1216
### Minor Enhancements

lib/jekyll/converters/scss.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,25 @@ def user_sass_load_paths
7171
end
7272

7373
def sass_dir_relative_to_site_source
74-
Jekyll.sanitized_path(@config["source"], sass_dir)
74+
Jekyll.sanitized_path(site_source, sass_dir)
7575
end
7676

7777
def sass_load_paths
7878
paths = user_sass_load_paths + [sass_dir_relative_to_site_source]
7979

8080
if safe?
8181
# Sanitize paths to prevent any attack vectors (.e.g. `/**/*`)
82-
paths.map! { |path| Jekyll.sanitized_path(@config["source"], path) }
82+
paths.map! { |path| Jekyll.sanitized_path(site_source, path) }
8383
end
8484

8585
# Expand file globs (e.g. `node_modules/*/node_modules` )
86-
Dir.chdir(@config["source"]) do
86+
Dir.chdir(site_source) do
8787
paths = paths.map { |path| Dir.glob(path) }.flatten.uniq
8888

8989
paths.map! do |path|
9090
if safe?
9191
# Sanitize again in case globbing was able to do something crazy.
92-
Jekyll.sanitized_path(@config["source"], path)
92+
Jekyll.sanitized_path(site_source, path)
9393
else
9494
File.expand_path(path)
9595
end
@@ -122,6 +122,11 @@ def convert(content)
122122
rescue ::Sass::SyntaxError => e
123123
raise SyntaxError.new("#{e.to_s} on line #{e.sass_line}")
124124
end
125+
126+
private
127+
def site_source
128+
@site_source ||= File.expand_path(@config["source"]).freeze
129+
end
125130
end
126131
end
127132
end

script/spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test

script/test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
bundle exec rspec $@

0 commit comments

Comments
 (0)