mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C#: Fix test for AspLine.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import csharp
|
||||
import semmle.code.csharp.security.dataflow.XSS
|
||||
|
||||
string tweakMemberLocation(XSS::AspInlineMember inline, Member member) {
|
||||
string tweakMemberLocation(Member member) {
|
||||
exists(Location loc |
|
||||
loc = member.getLocation() and
|
||||
if loc.getFile().getParentContainer() = inline.getLocation().getFile().getParentContainer()
|
||||
if loc instanceof SourceLocation
|
||||
then result = loc.toString()
|
||||
else result = "<outside test directory>"
|
||||
)
|
||||
@@ -14,4 +14,4 @@ from XSS::AspInlineMember inline, Member member
|
||||
where member = inline.getMember()
|
||||
// some members, such as ASP members inherited from DLLs, are outside the test directory,
|
||||
// so we select them specially using a modified location and the normal toString
|
||||
select inline, tweakMemberLocation(inline, member), member.toString()
|
||||
select inline, tweakMemberLocation(member), member.toString()
|
||||
|
||||
Reference in New Issue
Block a user