From dc6a225c27986e6d029df5bdf38d89264a4c2cbc Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 11 Jun 2008 14:14:25 +0000 Subject: [PATCH] Textarea needs to be filtered when shown as HTML --- lib/WebGUI/Form/HTMLArea.pm | 5 +++++ lib/WebGUI/Form/Textarea.pm | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lib/WebGUI/Form/HTMLArea.pm b/lib/WebGUI/Form/HTMLArea.pm index a1a885815..a82c65b58 100644 --- a/lib/WebGUI/Form/HTMLArea.pm +++ b/lib/WebGUI/Form/HTMLArea.pm @@ -132,6 +132,11 @@ sub getValue { return WebGUI::HTML::cleanSegment($self->SUPER::getValue(@_)); } +sub getValueAsHtml { + my $self = shift; + return $self->WebGUI::Form::Control::getValueAsHtml(@_); +} + #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/Textarea.pm b/lib/WebGUI/Form/Textarea.pm index e7a5ec369..df53ffd54 100644 --- a/lib/WebGUI/Form/Textarea.pm +++ b/lib/WebGUI/Form/Textarea.pm @@ -172,6 +172,12 @@ sub toHtml { return $out; } +sub getValueAsHtml { + my $self = shift; + my $value = $self->SUPER::getValueAsHtml(@_); + $value = WebGUI::HTML::filter($value, 'text'); + return $value; +} 1;