[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonbulletin.pm loncoursegroups.pm lonsimplepage.pm lonsyllabus.pm

raeburn raeburn at source.lon-capa.org
Tue Sep 17 11:04:31 EDT 2013


raeburn		Tue Sep 17 15:04:31 2013 EDT

  Modified files:              
    /loncom/interface	lonsimplepage.pm lonaboutme.pm lonbulletin.pm 
                     	loncoursegroups.pm lonsyllabus.pm 
  Log:
  - Bug 6669
    - lonhtmlgateway::process_incoming_html() used instead of 
      lonfeedback::clear_out_html() to ensure fields contain valid xhtml.
      (more HTML tags now supported).
   - requires perl-XML-LibXML 1.62 or newer:
     update needed on CentOS/RHEL/Scientific Linux 5; SLES 9/10; RHEL 4.  
  
  
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.102 loncom/interface/lonsimplepage.pm:1.103
--- loncom/interface/lonsimplepage.pm:1.102	Mon Mar 11 02:04:36 2013
+++ loncom/interface/lonsimplepage.pm	Tue Sep 17 15:04:30 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.102 2013/03/11 02:04:36 raeburn Exp $
+# $Id: lonsimplepage.pm,v 1.103 2013/09/17 15:04:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -33,8 +33,7 @@
 use Apache::loncommon;
 use Apache::lontemplate;
 use Apache::lonnet;
-use Apache::lontexconvert;
-use Apache::lonfeedback;
+use Apache::lonhtmlgateway;
 use Apache::lonlocal;
 use Apache::lonprintout;
 use Apache::lonxml;
@@ -259,10 +258,8 @@
         foreach my $syl_field (keys(%syllabusfields)) {
             my $field=$env{'form.'.$syl_field};
             chomp($field);
-            $field=~s/\s+$//s;
-            $field=~s/^\s+//s;
-            $field=~s/\<br\s*\/*\>$//s;
-            $field=&Apache::lonfeedback::clear_out_html($field,1);
+            my $gateway = Apache::lonhtmlgateway->new();
+            $field = $gateway->process_incoming_html($field,1);
             $syllabus{$syl_field}=$field;
         }
         $syllabus{'uploaded.lastmodified'}=time;
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.154 loncom/interface/lonaboutme.pm:1.155
--- loncom/interface/lonaboutme.pm:1.154	Fri May  3 16:26:43 2013
+++ loncom/interface/lonaboutme.pm	Tue Sep 17 15:04:30 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.154 2013/05/03 16:26:43 bisitz Exp $
+# $Id: lonaboutme.pm,v 1.155 2013/09/17 15:04:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -78,7 +78,7 @@
 use Apache::loncommon;
 use Apache::lonnet;
 use Apache::lontexconvert;
-use Apache::lonfeedback;
+use Apache::lonhtmlgateway;
 use Apache::lonrss();
 use Apache::lonlocal;
 use Apache::lonmsgdisplay();
@@ -312,8 +312,9 @@
     if (($allowed) && ($env{'form.storesyl'})) {
         foreach my $syl_field (keys(%syllabusfields)) {
             my $field=$env{'form.'.$syl_field};
-            $field=~s/\s+$//s;
-            $field=&Apache::lonfeedback::clear_out_html($field,$env{'user.adv'});
+            chomp($field);
+            my $gateway = Apache::lonhtmlgateway->new();
+            $field = $gateway->process_incoming_html($field,1);
             $syllabus{$syl_field}=$field;
         }
         $syllabus{'uploaded.lastmodified'}=time;
Index: loncom/interface/lonbulletin.pm
diff -u loncom/interface/lonbulletin.pm:1.66 loncom/interface/lonbulletin.pm:1.67
--- loncom/interface/lonbulletin.pm:1.66	Fri Dec  7 17:15:56 2012
+++ loncom/interface/lonbulletin.pm	Tue Sep 17 15:04:30 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Bulletin Board Handler
 #
-# $Id: lonbulletin.pm,v 1.66 2012/12/07 17:15:56 raeburn Exp $
+# $Id: lonbulletin.pm,v 1.67 2013/09/17 15:04:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -33,7 +33,8 @@
 use Apache::loncommon;
 use Apache::lonnet;
 use Apache::lontexconvert;
-use Apache::lonfeedback;
+use Apache::lonfeedback; 
+use Apache::lonhtmlgateway;
 use Apache::lonlocal;
 use Apache::lonhtmlcommon;
 use HTML::Entities();
@@ -211,8 +212,9 @@
     if (($allowed) && ($env{'form.storesyl'})) {
         foreach my $syl_field (keys(%syllabusfields)) {
             my $field=$env{'form.'.$syl_field};
-            $field=~s/\s+$//s;
-            $field=&Apache::lonfeedback::clear_out_html($field,1);
+            chomp($field);
+            my $gateway = Apache::lonhtmlgateway->new();
+            $field = $gateway->process_incoming_html($field,1);
             $syllabus{$syl_field}=$field;
         }
         $syllabus{'uploaded.lastmodified'}=time;
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.120 loncom/interface/loncoursegroups.pm:1.121
--- loncom/interface/loncoursegroups.pm:1.120	Fri Aug 30 17:17:02 2013
+++ loncom/interface/loncoursegroups.pm	Tue Sep 17 15:04:30 2013
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursegroups.pm,v 1.120 2013/08/30 17:17:02 raeburn Exp $
+# $Id: loncoursegroups.pm,v 1.121 2013/09/17 15:04:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -31,6 +31,7 @@
 use Apache::lonnet;
 use Apache::loncommon();
 use Apache::lonhtmlcommon();
+use Apache::lonhtmlgateway;
 use Apache::lonlocal;
 use Apache::lonnavmaps();
 use Apache::longroup();
@@ -4120,10 +4121,9 @@
     my ($cdom,$cnum,$name,$groupinfo,$tools,$gpterm,$ucgpterm,$now) = @_;
     my $functionality = join(',',@{$tools});
     my $content = &unescape($$groupinfo{description});
-    $content=~s/\s+$//s;
-    $content=~s/^\s+//s;
-    $content=~s/\<br\s*\/*\>$//s;
-    $content=&Apache::lonfeedback::clear_out_html($content,1);
+    chomp($content);
+    my $gateway = Apache::lonhtmlgateway->new();
+    $content = $gateway->process_incoming_html($content,1);
 
     my %pageinfo = (
                      'aaa_title' => "$ucgpterm: $name",
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.132 loncom/interface/lonsyllabus.pm:1.133
--- loncom/interface/lonsyllabus.pm:1.132	Sun Sep  1 01:12:01 2013
+++ loncom/interface/lonsyllabus.pm	Tue Sep 17 15:04:30 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.132 2013/09/01 01:12:01 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.133 2013/09/17 15:04:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -35,6 +35,7 @@
 use Apache::lonnet;
 use Apache::lontexconvert;
 use Apache::lonfeedback;
+use Apache::lonhtmlgateway;
 use Apache::lonannounce;
 use Apache::lonlocal;
 use Apache::lonhtmlcommon;
@@ -1174,10 +1175,8 @@
         foreach my $syl_field (keys(%{$syllabusfields})) {
             my $field=$env{'form.'.$syl_field};
             chomp($field);
-            $field=~s/\s+$//s;
-            $field=~s/^\s+//s;
-            $field=~s/\<br\s*\/*\>$//s;
-            $field=&Apache::lonfeedback::clear_out_html($field,1);
+            my $gateway = Apache::lonhtmlgateway->new();
+            $field = $gateway->process_incoming_html($field,1);
                             #here it will be stored
             $syllabus->{$syl_field}=$field;
             if ($syl_field eq 'lll_includeurl') { # clean up included URLs




More information about the LON-CAPA-cvs mailing list