X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPresenter%2FTag.pm;h=bd489066b5f25d3572d7ccb2dfcad8a0f79c40ab;hb=13a7879c8ccbd967869e2eeeae76065c6cb4c4f0;hp=924ab8b574c38d0c0c872041c697bbb41ea2ca98;hpb=ddaaf1ddfa1ab9351101a2dda89f3ba763ebd1a2;p=kivitendo-erp.git diff --git a/SL/Presenter/Tag.pm b/SL/Presenter/Tag.pm index 924ab8b57..bd489066b 100644 --- a/SL/Presenter/Tag.pm +++ b/SL/Presenter/Tag.pm @@ -2,10 +2,12 @@ package SL::Presenter::Tag; use strict; +use SL::HTML::Restrict; + use parent qw(Exporter); use Exporter qw(import); -our @EXPORT = qw(html_tag input_tag man_days_tag name_to_id select_tag stringify_attributes); +our @EXPORT = qw(html_tag input_tag man_days_tag name_to_id select_tag stringify_attributes restricted_html); use Carp; @@ -195,6 +197,15 @@ sub _set_id_attribute { return %{ $attributes }; } +my $html_restricter; + +sub restricted_html { + my ($self, $value) = @_; + + $html_restricter ||= SL::HTML::Restrict->create; + return $html_restricter->process($value); +} + 1; __END__ @@ -264,6 +275,10 @@ Creates a string from all elements in C<%items> suitable for usage as HTML tag attributes. Keys and values are HTML escaped even though keys must not contain non-ASCII characters for browsers to accept them. +=item C + +Returns HTML stripped of unknown tags. See L. + =back =head2 HIGH-LEVEL FUNCTIONS