mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
Fixes #7698.
markup: Allow installed arbitrary Asciidoc extension via path validation.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
c8f45d1d86
commit
01dd7c16af
@@ -19,6 +19,7 @@ package asciidocext
|
||||
import (
|
||||
"bytes"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/gohugoio/hugo/htesting"
|
||||
|
||||
@@ -105,11 +106,10 @@ func (a *asciidocConverter) parseArgs(ctx converter.DocumentContext) []string {
|
||||
args = a.appendArg(args, "-b", cfg.Backend, asciidocext_config.CliDefault.Backend, asciidocext_config.AllowedBackend)
|
||||
|
||||
for _, extension := range cfg.Extensions {
|
||||
if !asciidocext_config.AllowedExtensions[extension] {
|
||||
a.cfg.Logger.Errorln("Unsupported asciidoctor extension was passed in. Extension `" + extension + "` ignored.")
|
||||
if strings.LastIndexAny(extension, `\/.`) > -1 {
|
||||
a.cfg.Logger.Errorln("Unsupported asciidoctor extension was passed in. Extension `" + extension + "` ignored. Only installed asciidoctor extensions are allowed.")
|
||||
continue
|
||||
}
|
||||
|
||||
args = append(args, "-r", extension)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user