aboutsummaryrefslogtreecommitdiff
path: root/internal/form/form.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/form/form.go')
-rw-r--r--internal/form/form.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/form/form.go b/internal/form/form.go
index 4cd81fac..e2fe1a1f 100644
--- a/internal/form/form.go
+++ b/internal/form/form.go
@@ -7,17 +7,18 @@ package form
import (
"fmt"
"reflect"
- "regexp"
"strings"
- "github.com/unknwon/com"
"github.com/go-macaron/binding"
+ "github.com/unknwon/com"
"gopkg.in/macaron.v1"
+
+ "gogs.io/gogs/internal/lazyregexp"
)
const ERR_ALPHA_DASH_DOT_SLASH = "AlphaDashDotSlashError"
-var AlphaDashDotSlashPattern = regexp.MustCompile("[^\\d\\w-_\\./]")
+var AlphaDashDotSlashPattern = lazyregexp.New("[^\\d\\w-_\\./]")
func init() {
binding.SetNameMapper(com.ToSnakeCase)