C#: Recognize more calls to IHtmlHelper.Raw#3509
Merged
calumgrant merged 2 commits intogithub:masterfrom Jun 15, 2020
Merged
Conversation
calumgrant
suggested changes
May 19, 2020
Contributor
calumgrant
left a comment
There was a problem hiding this comment.
Thanks for adding these. There should probably be a test for the new sink. (If it's difficult and annoying to add trivial tests then we need to discuss how to make that easier.)
| getNamespace() instanceof MicrosoftAspNetCoreMvcViewFeatures and | ||
| hasName("HtmlHelper") | ||
| /** The `Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper` interface. */ | ||
| class MicrosoftAspNetCoreMvcRenderingHtmlHelperInterface extends Interface { |
Contributor
There was a problem hiding this comment.
Should be called MicrosoftAspNetCoreMvcRenderingIHtmlHelperInterface (extra I)
| c.getTarget() = target and | ||
| target.hasName("Raw") and | ||
| target.getDeclaringType().getABaseType*() instanceof | ||
| MicrosoftAspNetCoreMvcRenderingHtmlHelperInterface and |
Contributor
There was a problem hiding this comment.
I'm happy with this -- however, do we want to model things in terms of a getRawMethod() on MicrosoftAspNetCoreMvcRenderingHtmlHelperInterface ?
Contributor
Author
There was a problem hiding this comment.
Then we need to involve the overrides relation as well, which just complicates things even more.
Generalize logic by recognizing not only calls to `Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.Raw()`, but calls to all `Raw()` methods that implement `Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper.Raw()`.
Contributor
Author
|
As discussed offline, I have removed the test again, to avoid checking in DLLs. |
calumgrant
approved these changes
Jun 15, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generalize logic by recognizing not only calls to
Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.Raw(), but calls to allRaw()methods that implementMicrosoft.AspNetCore.Mvc.Rendering.IHtmlHelper.Raw().