Skip to content

Commit

Permalink
removed checker for url
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidanio committed Aug 5, 2024
1 parent 4c15f34 commit 87eb7ec
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion src/linter/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import (
// 52 - renamed all PhpDoc and Phpdoc with PHPDoc
// 53 - added DeprecationInfo for functions and methods and support for some attributes
// 54 - forced cache version invalidation due to the #1165
// 55 - added @link tag -> new field in Rule
const cacheVersion = 54

var (
Expand Down
11 changes: 1 addition & 10 deletions src/rules/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,7 @@ func (p *parser) parseRuleInfo(st ir.Node, labelStmt ir.Node, proto *Rule) (Rule
if len(part.Params) != 1 {
return rule, p.errorf(st, "@link expects exactly 1 param, got %d", len(part.Params))
}
var link = part.Params[0]
if !isURL(link) {
return rule, p.errorf(st, "@link argument is not link")
}
rule.Link = link
rule.Link = part.Params[0]

case "location":
if len(part.Params) != 1 {
Expand Down Expand Up @@ -348,11 +344,6 @@ func (p *parser) parseRuleInfo(st ir.Node, labelStmt ir.Node, proto *Rule) (Rule
return rule, nil
}

func isURL(str string) bool {
re := regexp.MustCompile(`^((https?|ftp)://)?[^\s/$.?#].\S*$`)
return re.MatchString(str)
}

func (p *parser) parseRules(stmts []ir.Node, proto *Rule) error {
for len(stmts) > 0 {
stmt := stmts[0]
Expand Down

0 comments on commit 87eb7ec

Please sign in to comment.