File tree Expand file tree Collapse file tree 5 files changed +19
-12
lines changed
Expand file tree Collapse file tree 5 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -3,19 +3,14 @@ language: ruby
33rvm :
44- 2.2.4
55- 2.1.8
6- - ruby-head
76matrix :
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
1510env :
1611 matrix :
1712 - JEKYLL_VERSION=2.5
18- - JEKYLL_VERSION=3.1
13+ - JEKYLL_VERSION=3.3
1914branches :
2015 only :
2116 - master
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
127132end
Original file line number Diff line number Diff line change 1+ test
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ bundle exec rspec $@
You can’t perform that action at this time.
0 commit comments