[ 1008039 ] When adding javascript to description, the script is doubled
This commit is contained in:
parent
029fcc595d
commit
fb6fab4226
2 changed files with 22 additions and 10 deletions
|
|
@ -85,6 +85,8 @@
|
||||||
- bugfix [ 1016258 ] Empty Trash Typo (Tavis Parker).
|
- bugfix [ 1016258 ] Empty Trash Typo (Tavis Parker).
|
||||||
- bugfix [ 1017727 ] Redirect URL (on edit page) not redirecting
|
- bugfix [ 1017727 ] Redirect URL (on edit page) not redirecting
|
||||||
- RFE [ 718739 ]. USS Submission Start/End Dates (Thanks to Roy Johnson).
|
- RFE [ 718739 ]. USS Submission Start/End Dates (Thanks to Roy Johnson).
|
||||||
|
- bugfix [ 1008039 ] When adding javascript to description, the script is
|
||||||
|
doubled
|
||||||
|
|
||||||
|
|
||||||
6.1.1
|
6.1.1
|
||||||
|
|
|
||||||
|
|
@ -66,17 +66,27 @@ The HTML segment you want cleaned.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub cleanSegment {
|
sub cleanSegment {
|
||||||
my $value = $_[0];
|
my $html = shift;
|
||||||
if ($value =~ s/\r/\n/g) {
|
# remove windows carriage returns
|
||||||
$value =~ s/\n\n/\n/g
|
if ($html =~ s/\r/\n/g) {
|
||||||
|
$html =~ s/\n\n/\n/g
|
||||||
}
|
}
|
||||||
$value =~ m/(\<style.*?\/style\>)/ixsg;
|
# remove meta tags
|
||||||
my $style = $1;
|
$html =~ s/\<meta.*?\>//ixsg;
|
||||||
$value =~ m/(\<script.*?\/script\>)/ixsg;
|
# remove link tags
|
||||||
my $script = $1;
|
$html =~ s/\<link.*?\>//ixsg;
|
||||||
$value =~ s/\A.*?\<body.*?\>(.*?)/$1/ixsg;
|
# remove title tags
|
||||||
$value =~ s/(.*?)\<\/body\>.*?\z/$1/ixsg;
|
$html =~ s/\<title\>.*?\<\/title\>//ixsg;
|
||||||
return $script.$style.$value;
|
# remove head tags
|
||||||
|
$html =~ s/\<head.*?\>//ixsg;
|
||||||
|
$html =~ s/\<\/head>//ixsg;
|
||||||
|
# remove body tags
|
||||||
|
$html =~ s/\<body.*?\>//ixsg;
|
||||||
|
$html =~ s/\<\/body>//ixsg;
|
||||||
|
# remove html tags
|
||||||
|
$html =~ s/\<html>//ixsg;
|
||||||
|
$html =~ s/\<\/html>//ixsg;
|
||||||
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue