Child of #2549943: [plan] Remove as much of the SafeMarkup class's methods as possible and blocked by #2544684: Expand @internal documentation on SafeString and SafeStringInterface and introduce ViewsRenderPipelineSafeString and (i think) we'll need the Html::encodeEntitiesIfUnsafe() from #2549791: Remove SafeMarkup::xssFilter() and provide ability to define #markup escaping strategy and what tags to filter
Remove SafeMarkup::replace() and in views_pre_render_views_form_views_form() use the new ViewsRenderPipelineSafeString() instead.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2550055.7.patch | 9.54 KB | alexpott |
| #6 | 2550055-6.patch | 1.03 KB | geertvd |
Comments
Comment #2
alexpottSo the current use of SafeMarkup::replace() in views_pre_render_views_form_views_form() is extremely problematic. If any implementation of hook_views_form_substitutions() returned an unsafe string in either the placeholder or substitution the output of SakeMarkup::replace would be marked unsafe regardless of whether the replacement has actually taken place.
This makes this issue a bug.
Comment #3
alexpottComment #4
alexpottComment #5
geertvd commentedComment #6
geertvd commentedRemoved that unnecessary enter
Comment #7
alexpottPatch attached removes SafeMarkup::replace() and adds test coverage of the interaction between hook_views_form_substitutions() and views_pre_render_views_form_views_form().
Comment #8
wim leers\o/ \o/ \o/
s/a/are/ — can be fixed on commit.
Comment #9
dawehnerJust checked, we don't pass the view: core/modules/views/views.module:664
Comment #10
catchFixed the typo on commit.
Committed/pushed to 8.0.x, thanks!
Comment #12
alexpottUpdated https://www.drupal.org/node/2549395