Skip to content

Commit

Permalink
Merge pull request CactuseSecurity#2209 from CactuseSecurity/develop
Browse files Browse the repository at this point in the history
Main fix git mix-up
  • Loading branch information
tpurschke authored Jul 27, 2023
2 parents 2349f64 + f6644e8 commit 8abd825
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
20 changes: 7 additions & 13 deletions roles/lib/files/FWO.Report.Filter/Scanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,14 @@ private List<Token> TryExtractToken(int beginPosition, string text, bool surroun

if (noWhitespaceTokens.TryGetValue(tokenText, out TokenKind tokenKind))
{
Token realToken = validToken;

if (!IsWhitespaceOrEnd(beginPosition + potentialTokenText.Length))
if (!IsWhitespaceOrEnd(beginPosition + text.Length) &&
noWhitespaceTokens.TryGetValue(tokenText + input[beginPosition + text.Length], out TokenKind realTokenKind))
{
foreach (Token longerToken in noWhitespaceTokens)
{
if (longerToken != validToken && (potentialTokenText + input[beginPosition + potentialTokenText.Length]).EndsWith(longerToken.Text))
{
position++;
realToken = longerToken;
potentialTokenText += input[beginPosition + potentialTokenText.Length];
break;
}
}
tokenLength++;
position++;
tokenKind = realTokenKind;
tokenText += input[beginPosition + text.Length];
text += input[beginPosition + text.Length];
}

if (text.Length - tokenLength > 0)
Expand Down
6 changes: 0 additions & 6 deletions roles/test/files/FWO.Test/FilterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,5 @@ public void Brackets()
var res = Compiler.Compile(t);
}


[Test]
public void Brackets()
{
var res = Compiler.Compile("src=a&(dst=c)", ReportType.Rules);
}
}
}

0 comments on commit 8abd825

Please sign in to comment.