File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
ql/lib/codeql/ruby/regexp Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -671,15 +671,18 @@ class RegExp extends AST::RegExpLiteral {
671
671
}
672
672
673
673
predicate multiples ( int start , int end , string lower , string upper ) {
674
- this .getChar ( start ) = "{" and
675
- this .getChar ( end - 1 ) = "}" and
676
- exists ( string inner | inner = this .getText ( ) .substring ( start + 1 , end - 1 ) |
677
- inner .regexpMatch ( "[0-9]+" ) and
674
+ exists ( string text , string match , string inner |
675
+ text = this .getText ( ) and
676
+ end = start + match .length ( ) and
677
+ inner = match .substring ( 1 , match .length ( ) - 1 )
678
+ |
679
+ match = text .regexpFind ( "\\{[0-9]+\\}" , _, start ) and
678
680
lower = inner and
679
681
upper = lower
680
682
or
681
- inner .regexpMatch ( "[0-9]*,[0-9]*" ) and
682
- exists ( int commaIndex | commaIndex = inner .indexOf ( "," ) |
683
+ match = text .regexpFind ( "\\{[0-9]*,[0-9]*\\}" , _, start ) and
684
+ exists ( int commaIndex |
685
+ commaIndex = inner .indexOf ( "," ) and
683
686
lower = inner .prefix ( commaIndex ) and
684
687
upper = inner .suffix ( commaIndex + 1 )
685
688
)
You can’t perform that action at this time.
0 commit comments