mirror of
https://github.com/eiblog/eiblog.git
synced 2026-03-01 00:34:58 +08:00
update
This commit is contained in:
11
helper.go
11
helper.go
@@ -4,6 +4,7 @@ import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -24,3 +25,13 @@ func EncryptPasswd(name, pass string) string {
|
||||
func VerifyPasswd(origin, name, input string) bool {
|
||||
return origin == EncryptPasswd(name, input)
|
||||
}
|
||||
|
||||
func IgnoreHtmlTag(src string) string {
|
||||
//去除所有尖括号内的HTML代码
|
||||
re, _ := regexp.Compile("\\<[\\S\\s]+?\\>")
|
||||
src = re.ReplaceAllString(src, "")
|
||||
|
||||
//去除换行符
|
||||
re, _ = regexp.Compile("\\s{1,}")
|
||||
return re.ReplaceAllString(src, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user