Don't sanitize pattern or entry string

This commit is contained in:
Ashwin Maroli 2019-06-09 16:38:19 +05:30
parent 3002aa58f5
commit 119e0047e8
1 changed files with 2 additions and 2 deletions

View File

@ -89,12 +89,12 @@ module Jekyll
# Check if an entry matches a specific pattern.
# Returns true if path matches against any glob pattern, else false.
def glob_include?(enumerator, entry)
entry_with_source = site.in_source_dir(entry)
entry_with_source = File.join(site.source, entry)
enumerator.any? do |pattern|
case pattern
when String
pattern_with_source = site.in_source_dir(pattern)
pattern_with_source = File.join(site.source, pattern)
File.fnmatch?(pattern_with_source, entry_with_source) ||
entry_with_source.start_with?(pattern_with_source)