mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Prevent symbolic links from themes
This commit is contained in:
@@ -718,6 +718,7 @@ func createThemesOverlayFs(p *paths.Paths) (afero.Fs, []string, error) {
|
||||
}
|
||||
|
||||
fs, err := createOverlayFs(p.Fs.Source, absPaths)
|
||||
fs = hugofs.NewNoLstatFs(fs)
|
||||
|
||||
return fs, absPaths, err
|
||||
|
||||
|
@@ -218,6 +218,12 @@ func TestRealDirs(t *testing.T) {
|
||||
|
||||
checkFileCount(bfs.Resources.Fs, "", assert, 3)
|
||||
|
||||
assert.NotNil(bfs.themeFs)
|
||||
fi, b, err := bfs.themeFs.(afero.Lstater).LstatIfPossible(filepath.Join("resources", "t1.txt"))
|
||||
assert.NoError(err)
|
||||
assert.False(b)
|
||||
assert.Equal("t1.txt", fi.Name())
|
||||
|
||||
}
|
||||
|
||||
func TestStaticFs(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user