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

display of description impossible by htmlhelper #13

Open
opto opened this issue Dec 15, 2017 · 4 comments
Open

display of description impossible by htmlhelper #13

opto opened this issue Dec 15, 2017 · 4 comments

Comments

@opto
Copy link
Collaborator

opto commented Dec 15, 2017

I think the helper replaces the htmlspecialchars, so a strong will not be displayed as bold, but rather the html will be displayed as plain text.
Replacing the helper (only for description) with an echo of the descriptiion displays the formatted note

@caseysoftware
Copy link
Member

I've been playing with this one.

If we don't filter all html, we can run into problems when someone inserts a script tag (or worse). I'm happy to consider a better approach.

@opto
Copy link
Collaborator Author

opto commented Dec 21, 2017

I solved this by not using htmlhelper and writing into a div (I think it was a div).
If the user cannot switch off tinymce or ckeditor, this should be save - the only way to insert foreign html would be from the db.
I think the editors only insert those tags which are ok. I don't think they would insert script tags.
It would be a problem if the user could switch between the editor and a textarea while it is displayed as html. Then he could insert arbitrary tags.

@opto
Copy link
Collaborator Author

opto commented Dec 21, 2017

if we filter all html, there is no use for having an html editor ...

@caseysoftware
Copy link
Member

Alternatively, what if we used a whitelist of tags?

We would need: b, strong, i, em, ul, ol, li, p, blockquote, and... what else?

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

2 participants