Skip to content
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

Merged
merged 1 commit into from
Jan 6, 2016
Merged

filter.escape should not escape SafeString, close #618 #623

merged 1 commit into from
Jan 6, 2016

Conversation

atian25
Copy link
Contributor

@atian25 atian25 commented Dec 27, 2015

No description provided.

@atian25
Copy link
Contributor Author

atian25 commented Jan 2, 2016

rebase done.

@@ -117,7 +117,7 @@ var filters = {

escape: function(str) {
if(typeof str === 'string' ||
str instanceof r.SafeString) {
str instanceof r.SafeString === false) {
Copy link
Contributor

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.

@carljm
Copy link
Contributor

carljm commented Jan 4, 2016

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.

@atian25
Copy link
Contributor Author

atian25 commented Jan 5, 2016

@carljm thanks for review, had update.

carljm added a commit that referenced this pull request Jan 6, 2016
filter.escape should not escape SafeString, close #618
@carljm carljm merged commit d0a7e11 into mozilla:master Jan 6, 2016
@carljm
Copy link
Contributor

carljm commented Jan 6, 2016

Merged, thanks!

carljm added a commit that referenced this pull request Mar 17, 2016
filter.escape should not escape SafeString, close #618
carljm added a commit that referenced this pull request Mar 17, 2016
* 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'
@carljm carljm mentioned this pull request Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants