Merge remote-tracking branch 'upstream/release-5.1' into release-5.1-daily-merge-20180710
Этот коммит содержится в:
@@ -237,9 +237,19 @@ type ServiceSettings struct {
|
||||
EnableAPITeamDeletion *bool
|
||||
ExperimentalEnableHardenedMode *bool
|
||||
ExperimentalLimitClientConfig *bool
|
||||
EnableEmailInvitations *bool
|
||||
}
|
||||
|
||||
func (s *ServiceSettings) SetDefaults() {
|
||||
if s.EnableEmailInvitations == nil {
|
||||
// If the site URL is also not present then assume this is a clean install
|
||||
if s.SiteURL == nil {
|
||||
s.EnableEmailInvitations = NewBool(false)
|
||||
} else {
|
||||
s.EnableEmailInvitations = NewBool(true)
|
||||
}
|
||||
}
|
||||
|
||||
if s.SiteURL == nil {
|
||||
s.SiteURL = NewString(SERVICE_SETTINGS_DEFAULT_SITE_URL)
|
||||
}
|
||||
@@ -2418,7 +2428,7 @@ func (mes *MessageExportSettings) isValid(fs FileSettings) *AppError {
|
||||
|
||||
func (ds *DisplaySettings) isValid() *AppError {
|
||||
if len(*ds.CustomUrlSchemes) != 0 {
|
||||
validProtocolPattern := regexp.MustCompile(`(?i)^\s*[a-z][a-z0-9+.-]*\s*$`)
|
||||
validProtocolPattern := regexp.MustCompile(`(?i)^\s*[a-z][a-z0-9-]*\s*$`)
|
||||
|
||||
for _, scheme := range *ds.CustomUrlSchemes {
|
||||
if !validProtocolPattern.MatchString(scheme) {
|
||||
|
||||
@@ -466,7 +466,7 @@ func TestDisplaySettingsIsValidCustomUrlSchemes(t *testing.T) {
|
||||
{
|
||||
name: "containing period",
|
||||
value: []string{"iris.beep"},
|
||||
valid: true,
|
||||
valid: false, // should technically be true, but client doesn't support it
|
||||
},
|
||||
{
|
||||
name: "containing hyphen",
|
||||
@@ -476,7 +476,7 @@ func TestDisplaySettingsIsValidCustomUrlSchemes(t *testing.T) {
|
||||
{
|
||||
name: "containing plus",
|
||||
value: []string{"coap+tcp", "coap+ws"},
|
||||
valid: true,
|
||||
valid: false, // should technically be true, but client doesn't support it
|
||||
},
|
||||
{
|
||||
name: "starting with number",
|
||||
|
||||
Ссылка в новой задаче
Block a user