From: Moritz Bunkus Date: Thu, 7 Dec 2006 14:09:12 +0000 (+0000) Subject: Hilfsfunktionen fuer die Ausgabe von HTML-gequoteten Strings. X-Git-Tag: release-2.4.0^2~107 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=aacd5750af1d2371dff2abd2db5f6f5f0cca02e6;p=kivitendo-erp.git Hilfsfunktionen fuer die Ausgabe von HTML-gequoteten Strings. --- diff --git a/SL/Form.pm b/SL/Form.pm index 3b683f4f4..82962803c 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -219,6 +219,25 @@ sub unquote { } +sub quote_html { + $main::lxdebug->enter_sub(2); + + my ($self, $str) = @_; + + my %replace = + ('order' => ['"', '<', '>'], + '<' => '<', + '>' => '>', + '"' => '"', + ); + + map({ $str =~ s/$_/$replace{$_}/g; } @{ $replace{"order"} }); + + $main::lxdebug->leave_sub(2); + + return $str; +} + sub hide_form { my $self = shift; diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index c7dbfe5f2..4ca0b8a0c 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -415,4 +415,8 @@ sub set_longdescription { $lxdebug->leave_sub(); } +sub H { + return $form->quote_html($_[0]); +} + 1;