mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-06 03:01:43 -04:00
5
test/source/_posts/2014-01-06-permalink-traversal.md
Normal file
5
test/source/_posts/2014-01-06-permalink-traversal.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
permalink: /%2e%2e/baddie.html
|
||||
---
|
||||
|
||||
# Test
|
||||
@@ -103,6 +103,15 @@ class TestPost < Test::Unit::TestCase
|
||||
assert_equal "/my_category/permalinked-post", @post.url
|
||||
end
|
||||
|
||||
should "not be writable outside of destination" do
|
||||
post = setup_post("2014-01-06-permalink-traversal.md")
|
||||
do_render(post)
|
||||
post.write(dest_dir)
|
||||
|
||||
assert !File.exist?(File.expand_path("../baddie.html", dest_dir))
|
||||
assert File.exist(File.expand_path("/baddie.html", dest_dir))
|
||||
end
|
||||
|
||||
context "with CRLF linebreaks" do
|
||||
setup do
|
||||
@real_file = "2009-05-24-yaml-linebreak.markdown"
|
||||
|
||||
Reference in New Issue
Block a user