Replace www. from Domain too

Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
Jonas Franz 2018-06-25 13:26:34 +02:00
parent 3d722b7edc
commit fff3256339
No known key found for this signature in database
GPG Key ID: 506AEEBE80BEDECD
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ func IsExternalURL(rawURL string) bool {
if err != nil {
return true
}
if len(parsed.Host) != 0 && strings.Replace(parsed.Host, "www.", "", 1) != setting.Domain {
if len(parsed.Host) != 0 && strings.Replace(parsed.Host, "www.", "", 1) != strings.Replace(setting.Domain, "www.", "", 1) {
return true
}
return false

View File

@ -8,7 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/modules/setting"
"github.com/stretchr/testify/assert"
)