disable regex for the moment

This commit is contained in:
Niko Storni 2019-05-31 23:25:39 +02:00
parent 913c31a9f7
commit 68c164ed5d

View file

@ -1,10 +1,7 @@
package tagsManager
import (
"regexp"
"strings"
"github.com/lbryio/lbry.go/extras/errors"
)
const (
@ -65,16 +62,17 @@ func SanitizeTags(tags []string, youtubeChannelID string) ([]string, error) {
func normalizeTag(t string) (string, error) {
t = strings.ToLower(t)
r, err := regexp.Compile("/\\([^\\)]+\\)/g")
if err != nil {
return "", errors.Err(err)
}
r2, err := regexp.Compile("/[^\\w-'&]/g")
if err != nil {
return "", errors.Err(err)
}
t = r.ReplaceAllString(t, "")
return r2.ReplaceAllString(t, ""), nil
return t, nil
//r, err := regexp.Compile("/\\([^\\)]+\\)/g")
//if err != nil {
// return "", errors.Err(err)
//}
//r2, err := regexp.Compile("/[^\\w-'& \+]/g")
//if err != nil {
// return "", errors.Err(err)
//}
//t = r.ReplaceAllString(t, "")
//return r2.ReplaceAllString(t, ""), nil
}
type tagsSanitizer struct {