mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-29 00:38:03 -05:00
Feedback for flubbed regex and prefer File's directory check
This commit is contained in:
@@ -38,7 +38,7 @@ module Jekyll
|
||||
return unless resolved_dir
|
||||
|
||||
path = Jekyll.sanitized_path(root, resolved_dir)
|
||||
path if Dir.exist?(path)
|
||||
path if File.directory?(path)
|
||||
end
|
||||
|
||||
def realpath_for(folder)
|
||||
|
||||
@@ -92,7 +92,7 @@ module Jekyll
|
||||
# as well as the beginning "/" so we can enforce and ensure it.
|
||||
|
||||
def sanitize_url(str)
|
||||
"/" + str.gsub(%r!/{2,}!, "/").gsub(%r!\.+\/|\A\/+!, "")
|
||||
"/" + str.gsub(%r!/{2,}!, "/").gsub(%r!\.+/|\A/+!, "")
|
||||
end
|
||||
|
||||
# Escapes a path to be a valid URL path segment
|
||||
|
||||
Reference in New Issue
Block a user