-
Notifications
You must be signed in to change notification settings - Fork 66
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
Allow filters to respond in html #3578
Conversation
Allow filters to respond in html
What should I do with SensioLabsInsight — Code quality below expectations ? |
nothing |
but I'm not sure I'm in favor of this PR. I think all the hook calls apply the |
Hmm, I have checked this some time ago and |raw didn't make any changes. I will test it now to confirm. |
Ok this is the call |
It looks like in the past (1)(2)(3) with Smarty we used because hooks potentially provide user content we should probably do the same. So I propose closing this PR and documenting somewhere that hook filters should also be further filtered by the safeHtml filter.
(1) https://github.com/craigh/PostCalendar/blob/master/templates/user/list.tpl#L31 |
more thoughts:
|
Hmm I'm not sure if I understand you correctly. There are two things:
First one is deactivating "safe html" feature in notifiFilters method which strips tags by default. For user content in filter hooks, if tags need to be stripped then this should occur way before notifyFilters call, so hook filters can return output with some additional markup. Best examples are BBCode and BBsmile but I can imagine some kind of censor filter or even words highlighter or something like
Btw correct usage for pages: |
I'm suggesting this is the correct implementation:
|
If is_safe =>'html' will be added to notifyFilters method then this do not really matter as it is developers choice. I think that safeHtml filter should be before notifyFilters so filter hooks can work on already html safe content, while they can inject some html that will not be filtered out. So this PR, will be merged? or you have other plans? |
And btw I really think we do not understand each other.
This PR is removing safeHtml filter in notifyFilter by adding 'is_safe' => 'html' option this is disabling twig internall safeHtml filter https://twig.sensiolabs.org/doc/2.x/advanced.html#automatic-escaping |
@Kaik please sign the clahub agreement |
thank you @Kaik |
Allow filters to respond in html