diff --git a/common/httpx/copyright.go b/common/httpx/copyright.go index 27c386dcd..f647c3f79 100644 --- a/common/httpx/copyright.go +++ b/common/httpx/copyright.go @@ -6,20 +6,8 @@ import ( "strings" ) -var ( - crcutset = "\n\t\v\f\r," - crreYear = regexp.MustCompile(`(?:copyright|Copyright|COPYRIGHT|\(C\)|\(c\)|©|©|©)?\s*(?:[a-zA-Z0-9 ,-]+\s*)?[\s,]*(199[0-9]|20[0-1][0-9]|202[0-4])[\s,<-]+(?:copyright|Copyright|COPYRIGHT|\(C\)|\(c\)|©|©|©|199[0-9]|20[0-1][0-9]|202[0-4])?`) - - supportedYearMimeTypes = []string{ - "text/html", - "application/xhtml+xml", - "application/xml", - "application/rss+xml", - "application/atom+xml", - "application/xhtml+xml", - "application/vnd.wap.xhtml+xml", - } -) +var crreYear = regexp.MustCompile(`(?:copyright|Copyright|COPYRIGHT|\(C\)|\(c\)|©|©|©)?\s*(?:[a-zA-Z0-9 ,-]+\s*)?[\s,]*(199[0-9]|20[0-1][0-9]|202[0-4])[\s,<-]+(?:copyright|Copyright|COPYRIGHT|\(C\)|\(c\)|©|©|©|199[0-9]|20[0-1][0-9]|202[0-4])?`) + func cleanText(text string) string { text = strings.ReplaceAll(text, "", "")