You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've removed the |safe filter from the help_text as I can't see a reason to assume that it's safe (no more than the label, error messages or anything else). As always we should default to assuming that it's not. It can always be mark_safe()'d if necessary.
Well, for a couple of reasons... The help_text could have been translated
with ugettext and so isn't necessarily directly controlled by the
developer. And also because even if it is coded by the developer, the
developer will be expecting it to be escaped by django (like everything
else is). It doesn't seem to make sense to special case the help_text.
Django's philosophy is to escape everything at the template stage, unless
it's an instance of django.utils.safestring.SafeString (i.e. mark_safe()
has been called on it). The help_text should be no exception to this,
otherwise we wouldn't be escaping the labels or error messages or widget
attributes or anything else under the control of the developer either.
People can call mark_safe() on their help_text if they want to use HTML in
it. But we should default to escaping the same as everything else.
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
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.
I've removed the
|safefilter from thehelp_textas I can't see a reason to assume that it's safe (no more than the label, error messages or anything else). As always we should default to assuming that it's not. It can always bemark_safe()'d if necessary.