mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
C#: Recognize all overloads of String.Replace as a replace method.
This commit is contained in:
@@ -346,11 +346,11 @@ class SystemStringClass extends StringType {
|
||||
result.hasName("==")
|
||||
}
|
||||
|
||||
/** Gets the `Replace(string/char, string/char)` method. */
|
||||
/** Gets the `Replace(...)` method. */
|
||||
Method getReplaceMethod() {
|
||||
result.getDeclaringType() = this and
|
||||
result.hasName("Replace") and
|
||||
result.getNumberOfParameters() = 2 and
|
||||
result.getNumberOfParameters() in [2 .. 4] and
|
||||
result.getReturnType() instanceof StringType
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user