-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filter.escape should not escape SafeString, close #618 #623
Conversation
rebase done. |
@@ -117,7 +117,7 @@ var filters = { | |||
|
|||
escape: function(str) { | |||
if(typeof str === 'string' || | |||
str instanceof r.SafeString) { | |||
str instanceof r.SafeString === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely doesn't look right; it would cause this filter to attempt to escape any object which is not a SafeString
. I think instead the entire conditional can be simplified to just if(typeof str === 'string')
removing the ||
entirely.
Thanks for the PR! Normally we don't compile the browser versions for every single change -- that just dramatically increases the likelihood of conflicts between pull requests. Can you update this PR to just add the test and change the source, but not include the compiled files? Also, please add a note in the changelog about this change. It's backwards-incompatible, so I think it'll need to go into v3. |
@carljm thanks for review, had update. |
filter.escape should not escape SafeString, close #618
Merged, thanks! |
filter.escape should not escape SafeString, close #618
* 2.x: Bump version to 2.5.0-dev.2. Update version in Changelog, too. Release 2.4.1. Backport not escaping SafeString; it's a bug. Update changelog. Merge pull request #701 from legutierr/master Merge pull request #623 from atian25/filters-escape Throw an error if a block is defined multiple times. Refs #696. Update changelog. Grammar fixes. Merge pull request #691 from dkebler/file-ext Update changelog. Merge branch 't576'
No description provided.