diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index c602cfafd..3ca6fde8a 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -16,6 +16,8 @@ - Macros are now negated on user profile fields and authentication fields. - Bugfix [ 930425 ] Bug in EventsCalender, causing other wobjects to fail. + - Bugfix [ 925586 ] HttpProxy ignores javascript in (thanks to + Nicklous Roberts). diff --git a/lib/WebGUI/HTML.pm b/lib/WebGUI/HTML.pm index 71ad36749..81e4fc604 100644 --- a/lib/WebGUI/HTML.pm +++ b/lib/WebGUI/HTML.pm @@ -47,9 +47,9 @@ These methods are available from this package: =head2 cleanSegment ( html ) -Returns an HTML segment that has been stripped of the tag and anything before it, as well as the tag and anything after it. +Returns an HTML segment that has been stripped of the tag and anything before it, as well as the tag and anything after it. It's main purpose is to get rid of META tags and other garbage from an HTML page that will be used as a segment inside of another page. -NOTE: This filter does have one exception, it leaves anything before the tag that is enclosed in tags. +NOTE: This filter does have one exception, it leaves anything before the tag that is enclosed in or tags. =over @@ -62,16 +62,17 @@ The HTML segment you want cleaned. =cut sub cleanSegment { - my ($style, $value); - $value = $_[0]; + my $value = $_[0]; if ($value =~ s/\r/\n/g) { $value =~ s/\n\n/\n/g } $value =~ m/(\)/ixsg; - $style = $1; - $value =~ s/\A.*?\(.*?)/$style$1/ixsg; + my $style = $1; + $value =~ m/(\)/ixsg; + my $script = $1; + $value =~ s/\A.*?\(.*?)/$1/ixsg; $value =~ s/(.*?)\<\/body\>.*?\z/$1/ixsg; - return $value; + return $script.$style.$value; } #-------------------------------------------------------------------