Website link are mandatory
Cette révision appartient à :
Parent
41b57edfe3
révision
fff53fcb5b
|
@ -122,11 +122,12 @@ func (f *UploadForm) ExtractInfo(r *http.Request) error {
|
||||||
} else {
|
} else {
|
||||||
return ErrInvalidTorrentCategory
|
return ErrInvalidTorrentCategory
|
||||||
}
|
}
|
||||||
|
if f.WebsiteLink != "" {
|
||||||
// WebsiteLink
|
// WebsiteLink
|
||||||
urlRegexp, _ := regexp.Compile(`^(https?:\/\/|irc:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$`)
|
urlRegexp, _ := regexp.Compile(`^(https?:\/\/|irc:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$`)
|
||||||
if !urlRegexp.MatchString(f.WebsiteLink) {
|
if !urlRegexp.MatchString(f.WebsiteLink) {
|
||||||
return ErrInvalidWebsiteLink
|
return ErrInvalidWebsiteLink
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// first: parse torrent file (if any) to fill missing information
|
// first: parse torrent file (if any) to fill missing information
|
||||||
|
|
Référencer dans un nouveau ticket