fixed macro filtering
This commit is contained in:
parent
af83b74240
commit
85eeaf28b4
3 changed files with 30 additions and 3 deletions
|
|
@ -3338,6 +3338,10 @@ delete from international where languageId=1 and namespace='HttpProxy' and inter
|
|||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (9,1,'HttpProxy','Cookie Jar', 1047835842);
|
||||
delete from international where languageId=1 and namespace='HttpProxy' and internationalId=5;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (5,1,'HttpProxy','Allow proxying of other domains?', 1047835817);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=891;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (891,1,'WebGUI','Only negate macros.', 1047838859);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=526;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (526,1,'WebGUI','Remove JavaScript and negate macros.', 1047838780);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ sub filter {
|
|||
if ($type eq "all") {
|
||||
$filter = HTML::TagFilter->new(allow=>{'none'},strip_comments=>1);
|
||||
$html = $filter->filter($_[0]);
|
||||
return WebGUI::Macro::filter($html);
|
||||
return WebGUI::Macro::negate($html);
|
||||
} elsif ($type eq "javascript") {
|
||||
$html = $_[0];
|
||||
$html =~ s/\<script.*?\/script\>//ixsg;
|
||||
|
|
@ -115,9 +115,9 @@ sub filter {
|
|||
$html =~ s/onKeyDown/removed/ixsg;
|
||||
$html =~ s/onSubmit/removed/ixsg;
|
||||
$html =~ s/onReset/removed/ixsg;
|
||||
$html = WebGUI::Macro::filter($html);
|
||||
$html = WebGUI::Macro::negate($html);
|
||||
} elsif ($type eq "macros") {
|
||||
return WebGUI::Macro::filter($_[0]);
|
||||
return WebGUI::Macro::negate($_[0]);
|
||||
} elsif ($type eq "none") {
|
||||
return $_[0];
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -123,6 +123,29 @@ sub getParams {
|
|||
return @param;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 negate ( html )
|
||||
|
||||
Nullifies all macros in this content segment.
|
||||
|
||||
=over
|
||||
|
||||
=item html
|
||||
|
||||
A string of HTML to be processed.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub negate {
|
||||
my $html = $_[0];
|
||||
$html =~ s/\^/\&\#94\;/g;
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 process ( html )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue