Skip to content

Commit

Permalink
Merge pull request #124 from tangyang9464/master
Browse files Browse the repository at this point in the history
fix: data can't contains comma ( , ) character
  • Loading branch information
hsluoyz authored Aug 5, 2021
2 parents bc167e6 + c30a2e5 commit ed2cfa4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"errors"
"fmt"
"runtime"
"strconv"
"strings"

"github.com/casbin/casbin/v2/model"
Expand Down Expand Up @@ -396,7 +397,8 @@ func (a *Adapter) dropTable() error {

func loadPolicyLine(line CasbinRule, model model.Model) {
var p = []string{line.Ptype,
line.V0, line.V1, line.V2, line.V3, line.V4, line.V5}
strconv.Quote(line.V0), strconv.Quote(line.V1), strconv.Quote(line.V2),
strconv.Quote(line.V3), strconv.Quote(line.V4), strconv.Quote(line.V5)}

var lineText string
if line.V5 != "" {
Expand Down

0 comments on commit ed2cfa4

Please sign in to comment.