Author: richter Date: Thu Jul 2 05:33:14 2015 New Revision: 1688763 URL: http://svn.apache.org/r1688763 Log: Fix readonly display of textarea
Modified: perl/embperl/trunk/Embperl/Form/Control/textarea.pm Modified: perl/embperl/trunk/Embperl/Form/Control/textarea.pm URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/textarea.pm?rev=1688763&r1=1688762&r2=1688763&view=diff ============================================================================== --- perl/embperl/trunk/Embperl/Form/Control/textarea.pm (original) +++ perl/embperl/trunk/Embperl/Form/Control/textarea.pm Thu Jul 2 05:33:14 2015 @@ -126,7 +126,7 @@ __EMBPERL__ $] -[$if !$self -> {fullwidth} $] +[$if !$self -> {fullwidth} || $self -> is_readonly ($req) $] [- $self -> SUPER::show ($req) -] [$else$] @@ -185,13 +185,13 @@ my $text = $self -> get_display_text ($ $text =~ s/\s*$// ; $text =~ s/^\s*// ; my $name = $self -> {force_name} || $self -> {name} ; -my $is_html = $self -> {format} eq 'html' ; +my $is_html = $self -> {format} eq 'html' && ($text =~ /^<[a-zA-Z0-9 "'=:-;,]+?>/) ; my @text = $is_html?($text):split (/\n/, $text) ; $] <div [+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, '', 'readonly') } +] _ef_divname="[+ $name +]"> [$ foreach my $val (@text) $] -[$ if $val =~ /^\s*$/ $]<br>[$else$] -[$if $is_html $][+ do { local $escmode = 0 ; $val } +][$else$][+ $val +][$endif$] +[$ if ($val =~ /^\s*$/) $]<br>[$else$] +[$if $is_html $][+ do { local $escmode = 0 ; $val } +][$else$][+ $val +]<br>[$endif$] [$endif$] [$endforeach$] </div> --------------------------------------------------------------------- To unsubscribe, e-mail: embperl-cvs-unsubscr...@perl.apache.org For additional commands, e-mail: embperl-cvs-h...@perl.apache.org