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

How to sanitize html? #13

Closed
nikhildaga opened this issue Jun 4, 2015 · 3 comments
Closed

How to sanitize html? #13

nikhildaga opened this issue Jun 4, 2015 · 3 comments

Comments

@nikhildaga
Copy link

In readme, you have mentioned
" Remember to sanitize the HTML on the server!"

Can you please give me an example of how to do it?

I am inserting docs in collection using yogiben:admin.

Thanks.

@jimmiebtlr
Copy link

meteor add djedi:sanitize-html

On the server in a before hook sanatize it

autoValue: function(){
  if( Meteor.isServer ){
    return sanitizeHtml( this.value );
  }else{
    return this.value;
  }
},

@nikhildaga
Copy link
Author

Thank you @jimmiebtlr :) . Its clear now.

@acomito
Copy link

acomito commented Mar 27, 2016

Can you provide a quick example of how to sanitize with this package? Autovalue is not where you would put it if you were using summer-note in an autoform correct? And autoform hooks are client-side, so we can't use sanatize in an autoform before hook?

It seems other people are confused as well. This person (link below) is trying to put the allowed values into the simpleschema's summer-note settings object , but it seems like the sanatize call has to happen in a method? That's assuming your autoform is submitted and updated using a method?

SO below:

http://stackoverflow.com/questions/36240098/sanatize-html-on-server-in-schema

Lastly, great package! Thanks.

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

No branches or pull requests

3 participants