--- loncom/publisher/loncleanup.pm 2005/05/31 17:41:38 1.5
+++ loncom/publisher/loncleanup.pm 2006/12/20 22:41:08 1.9
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to cleanup XML files
#
-# $Id: loncleanup.pm,v 1.5 2005/05/31 17:41:38 albertel Exp $
+# $Id: loncleanup.pm,v 1.9 2006/12/20 22:41:08 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,6 +38,9 @@ use Apache::loncacc;
use Apache::loncommon();
use Apache::lonlocal;
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub latextrans {
my $symbolfont=shift;
@@ -218,8 +221,9 @@ sub htmlclean {
}
# Generate empty tags, remove wrong end tags
unless ($blockemptytags) {
- $raw=~s/\<(br|hr|img|meta|allow|basefont)([^\>\/]*?)\>/\<$1$2 \/\>/gis;
- $raw=~s/\<\/(br|hr|img|meta|allow|basefont)\>//gis;
+ $raw=~s/\<(br|hr|img|meta|embed|allow|basefont)([^\>]*?)\>/\<$1$2 \/\>/gis;
+ $raw=~s/\<\/(br|hr|img|meta|embed|allow|basefont)\>//gis;
+ $raw=~s/\/ \/\>/\/\>/gs;
unless ($full) {
$raw=~s/\<[\/]*(body|head|html)\>//gis;
}
@@ -293,9 +297,9 @@ sub phasetwo {
$warningcount.' '.&mt('warning(s)').
'
'.
&mt('Open (and edit) cleaned up file in new window').''.
- '
'.
+ &escape($newuri).'" target="prev">'.
&mt('Show diffs in new window').'
'.
''.
''.
@@ -358,15 +362,12 @@ sub handler {
return HTTP_NOT_ACCEPTABLE;
}
- $fn=~s/\/\~(\w+)//;
+ $fn=~s{/~($LONCAPA::username_re)}{};
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
- my $html=&Apache::lonxml::xmlbegin();
- $r->print($html.'