X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FHTML%2FUtil.pm;h=72a7a7f57481a3522833d04bfc45740d3fccc27a;hb=13a7879c8ccbd967869e2eeeae76065c6cb4c4f0;hp=7212d646ffef763f22744972b07bf45b9c66c717;hpb=792ae733e8f54eca6d306ad523a7a6e166fcb0e0;p=kivitendo-erp.git diff --git a/SL/HTML/Util.pm b/SL/HTML/Util.pm index 7212d646f..72a7a7f57 100644 --- a/SL/HTML/Util.pm +++ b/SL/HTML/Util.pm @@ -6,6 +6,11 @@ use warnings; use HTML::Parser; my %stripper; +my %entities = ( + 'lt' => '<', + 'gt' => '>', + 'amp' => '&', +); sub strip { my ($class_or_value) = @_; @@ -22,6 +27,8 @@ sub strip { $stripper{parser}->parse($value); $stripper{parser}->eof; + $stripper{text} =~ s{\&([^;]+);}{ $entities{$1} || "\&$1;" }eg; + return delete $stripper{text}; }