diff --git a/src/linter/cache.go b/src/linter/cache.go index 5c5d08d4..79d499e6 100644 --- a/src/linter/cache.go +++ b/src/linter/cache.go @@ -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 ( diff --git a/src/rules/parser.go b/src/rules/parser.go index bf3a39c4..f6851663 100644 --- a/src/rules/parser.go +++ b/src/rules/parser.go @@ -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 { @@ -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]