mirror of
https://github.com/neocities/neocities.git
synced 2025-07-23 19:10:40 +02:00
patch bug where dir create didn't scrub path in db entry
This commit is contained in:
parent
58a09f0bd9
commit
b966321282
2 changed files with 10 additions and 2 deletions
|
@ -78,7 +78,7 @@ describe 'site_files' do
|
|||
@site.site_files.select {|sf| sf.path =~ /test2\/test.jpg/}.length.must_equal 1
|
||||
@site.site_files.select {|sf| sf.path =~ /test\/test.jpg/}.length.must_equal 0
|
||||
|
||||
PurgeCacheWorker.jobs.collect {|p| p['args'].last}.must_equal ["/test/test.jpg", "/test/index.html", "/test/", "test", "test2", "test/test.jpg", "test2/test.jpg", "test/index.html", "test/", "test2/index.html", "test2/"]
|
||||
PurgeCacheWorker.jobs.collect {|p| p['args'].last}.sort.must_equal ["/test/test.jpg", "/test/index.html", "/test/", "test", "test2", "test/test.jpg", "test2/test.jpg", "test/index.html", "test/", "test2/index.html", "test2/"].sort
|
||||
end
|
||||
|
||||
it 'doesnt wipe out existing file' do
|
||||
|
@ -450,6 +450,13 @@ describe 'site_files' do
|
|||
@site.reload.changed_count.must_equal 2
|
||||
end
|
||||
|
||||
describe 'directory create' do
|
||||
it 'scrubs ../ from directory' do
|
||||
@site.create_directory '../../test'
|
||||
@site.site_files.select {|site_file| site_file.path =~ /\.\./}.length.must_equal 0
|
||||
end
|
||||
end
|
||||
|
||||
describe 'classification' do
|
||||
before do
|
||||
puts "TODO FINISH CLASSIFIER"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue