diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-04-15 17:09:27 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-04-15 17:12:29 +0200 |
commit | 7881b0965f8b83d03379e9ed102cd0c3bce297e2 (patch) | |
tree | 7a0a25afb307c7a6eaae5c28c5f44355ee0cc458 /hugolib/page__meta.go | |
parent | 49d0a82641581aa7dd66b9d5e8c7d75e23260083 (diff) | |
download | hugo-7881b0965f8b83d03379e9ed102cd0c3bce297e2.tar.gz hugo-7881b0965f8b83d03379e9ed102cd0c3bce297e2.zip |
hugolib: Fix false WARNINGs in lang prefix check
Add a slash to the check to make it less likely to match a valid value.
Fixes #5860
Diffstat (limited to 'hugolib/page__meta.go')
-rw-r--r-- | hugolib/page__meta.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hugolib/page__meta.go b/hugolib/page__meta.go index 8e61ce138..64c72b895 100644 --- a/hugolib/page__meta.go +++ b/hugolib/page__meta.go @@ -381,7 +381,7 @@ func (pm *pageMeta) setMetadata(p *pageState, frontmatter map[string]interface{} return fmt.Errorf("URLs with protocol (http*) not supported: %q. In page %q", url, p.pathOrTitle()) } lang := p.s.GetLanguagePrefix() - if lang != "" && !strings.HasPrefix(url, "/") && strings.HasPrefix(url, lang) { + if lang != "" && !strings.HasPrefix(url, "/") && strings.HasPrefix(url, lang+"/") { if strings.HasPrefix(hugo.CurrentVersion.String(), "0.55") { // We added support for page relative URLs in Hugo 0.55 and // this may get its language path added twice. |