[LON-CAPA-cvs] cvs: loncom(version_0_6) /interface lonmsg.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 17 Mar 2003 16:55:06 -0000


albertel		Mon Mar 17 11:55:06 2003 EDT

  Modified files:              (Branch: version_0_6)
    /loncom/interface	lonmsg.pm 
  Log:
  - bacport of 1.48 (fully encode entities in messages)
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.42 loncom/interface/lonmsg.pm:1.42.2.1
--- loncom/interface/lonmsg.pm:1.42	Fri Oct 25 09:55:45 2002
+++ loncom/interface/lonmsg.pm	Mon Mar 17 11:55:06 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.42 2002/10/25 13:55:45 www Exp $
+# $Id: lonmsg.pm,v 1.42.2.1 2003/03/17 16:55:06 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -47,21 +47,23 @@
 use strict;
 use Apache::lonnet();
 use vars qw($msgcount);
-use HTML::TokeParser;
+use HTML::TokeParser();
 use Apache::Constants qw(:common);
-use Apache::loncommon;
-use Apache::lontexconvert;
+use Apache::loncommon();
+use Apache::lontexconvert();
+use HTML::Entities();
 
 # ===================================================================== Package
 
 sub packagemsg {
     my ($subject,$message,$citation)=@_;
-    $message=~s/\</\&lt\;/g;
-    $message=~s/\>/\&gt\;/g;
-    $citation=~s/\</\&lt\;/g;
-    $citation=~s/\>/\&gt\;/g;
-    $subject=~s/\</\&lt\;/g;
-    $subject=~s/\>/\&gt\;/g;
+#    $message=~s/\</\&lt\;/g;
+#    $message=~s/\>/\&gt\;/g;
+    $message =&HTML::Entities::encode($message);
+    $citation=&HTML::Entities::encode($citation);
+    $subject =&HTML::Entities::encode($subject);
+#    $subject=~s/\</\&lt\;/g;
+#    $subject=~s/\>/\&gt\;/g;
     my $now=time;
     $msgcount++;
     my $partsubj=$subject;