Avoid using Str_ internal class

This commit is contained in:
jorgectf
2021-12-19 19:56:58 +01:00
parent 018aa11bb6
commit 1b9567a1d8

View File

@@ -114,25 +114,25 @@ private module Sendgrid {
result = sendgridWrite("html_content")
or
exists(KeyValuePair content, Dict generalDict, KeyValuePair typePair, KeyValuePair valuePair |
content.getKey().(Str_).getS() = "content" and
content.getKey().(StrConst).getS() = "content" and
content.getValue().(List).getAnElt() = generalDict and
// declare KeyValuePairs keys and values
typePair.getKey().(Str_).getS() = "type" and
typePair.getValue().(Str_).getS() = ["text/html", "text/x-amp-html"] and
valuePair.getKey().(Str_).getS() = "value" and
typePair.getKey().(StrConst).getS() = "type" and
typePair.getValue().(StrConst).getS() = ["text/html", "text/x-amp-html"] and
valuePair.getKey().(StrConst).getS() = "value" and
result.asExpr() = valuePair.getValue() and
// correlate generalDict with previously set KeyValuePairs
generalDict.getAnItem() in [typePair, valuePair]
)
or
exists(KeyValuePair footer, Dict generalDict, KeyValuePair enablePair, KeyValuePair htmlPair |
footer.getKey().(Str_).getS() = ["footer", "subscription_tracking"] and
footer.getKey().(StrConst).getS() = ["footer", "subscription_tracking"] and
footer.getValue().(Dict) = generalDict and
// check footer is enabled
enablePair.getKey().(Str_).getS() = "enable" and
enablePair.getKey().(StrConst).getS() = "enable" and
exists(enablePair.getValue().(True)) and
// get html content
htmlPair.getKey().(Str_).getS() = "html" and
htmlPair.getKey().(StrConst).getS() = "html" and
result.asExpr() = htmlPair.getValue() and
// correlate generalDict with previously set KeyValuePairs
generalDict.getAnItem() in [enablePair, htmlPair]