From: Moritz Bunkus Date: Tue, 1 Apr 2014 11:47:03 +0000 (+0200) Subject: SL::HTML::Util::strip: HTML-Entitäten zurückübersetzen X-Git-Tag: release-3.2.0beta~467^2~11 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5de9f9f8e33b1fe8ab69cf38bc58d74cbec81779;p=kivitendo-erp.git SL::HTML::Util::strip: HTML-Entitäten zurückübersetzen --- diff --git a/SL/HTML/Util.pm b/SL/HTML/Util.pm index 7212d646f..0b2e630d0 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} }eg; + return delete $stripper{text}; }