From aacd5750af1d2371dff2abd2db5f6f5f0cca02e6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 7 Dec 2006 14:09:12 +0000 Subject: [PATCH] Hilfsfunktionen fuer die Ausgabe von HTML-gequoteten Strings. --- SL/Form.pm | 19 +++++++++++++++++++ bin/mozilla/common.pl | 4 ++++ 2 files changed, 23 insertions(+) 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; -- 2.20.1