package II3562149e53818b6637b38680e87ba918::tinymcefull; use strict; use base qw/II3562149e53818b6637b38680e87ba918::text/; use Zen::PerlHandler; use II13f08045bb56858ecda5a9ccd642c6bc; sub get { my ($this, $f) = @_; my ($rows, $cols, $addon) = split ',', Zen::PerlHandler->getStatList, 3; sprintf( qq(<textarea name="%s%s" rows="%s" cols="%s" class="summernote form-control" $addon>%s</textarea>), $this->pfx, $f, $rows, $cols, IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIllIlIIlll($II720d6e18aa34327713eb014408fc9144::IIlllIIllllIlIll{$IIb39071a48a82a07eeb9256f406abebc5::lIlIlIllIlllIIII},1016,$II720d6e18aa34327713eb014408fc9144::IIlllIIllllIlIll{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IlllIllIIIIIllIl})->HTMLEncode($this->getDecorated->{$f}) ); } sub set { my ($form, $f, $v) = @_; if (defined($v)) { $v = cleanup($v); } $form->getDecorated->{$f} = $v; return; } sub cleanup { my $v = shift; if ($v =~ m!<body[^>]*>(.+?)</body>!is) { my $body = $1; $v = '' if $body !~ /\S/; } if ($ENV{REQUEST_URI}) { my $cnv = sub { my $path = shift; return $path if $path =~ m!^/! || $path =~ m!^https?://!; my $uri = ($ENV{HTTPS} eq 'on' ? 'https' : 'http') . "://$ENV{HTTP_HOST}$ENV{REQUEST_URI}"; $uri =~ s!/[^/]+$!!; $uri .= "/$path"; my $loop = 1; while ($loop) { unless ($uri =~ s!/([^/]+)/\.\./!/!) { $loop = 0; } } $uri; }; $v =~ s!(<img[^>]+src=['"])(\S+)(['"][^>]*>)!$1.&$cnv($2).$3!gie; } $v =~ s!<(/?)mce:script!<$1script!gi; $v =~ s!\s+_mce_src! src!gi; return $v; } 1; 