]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Hilfsfunktionen fuer die Ausgabe von HTML-gequoteten Strings.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 7 Dec 2006 14:09:12 +0000 (14:09 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 7 Dec 2006 14:09:12 +0000 (14:09 +0000)
SL/Form.pm
bin/mozilla/common.pl

index 3b683f4f4e9512bcddc611774e2b077bdf4e570b..82962803c26872179ad52fc10a10fa79efa71b03 100644 (file)
@@ -219,6 +219,25 @@ sub unquote {
 
 }
 
+sub quote_html {
+  $main::lxdebug->enter_sub(2);
+
+  my ($self, $str) = @_;
+
+  my %replace =
+    ('order' => ['"', '<', '>'],
+     '<'             => '&lt;',
+     '>'             => '&gt;',
+     '"'             => '&quot;',
+    );
+
+  map({ $str =~ s/$_/$replace{$_}/g; } @{ $replace{"order"} });
+
+  $main::lxdebug->leave_sub(2);
+
+  return $str;
+}
+
 sub hide_form {
   my $self = shift;
 
index c7dbfe5f22655a529153caaaebfa48b28c384a1b..4ca0b8a0cd36e17d695301666b8616ec06d3d58c 100644 (file)
@@ -415,4 +415,8 @@ sub set_longdescription {
   $lxdebug->leave_sub();
 }
 
+sub H {
+  return $form->quote_html($_[0]);
+}
+
 1;