[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm

faziophi faziophi@source.lon-capa.org
Tue, 26 Jan 2010 05:22:04 -0000


faziophi		Tue Jan 26 05:22:04 2010 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  Regexp inside raw_href_to_link() now stops match upon finding "<" in order
  to prevent "http://mysite.com<br/>" from turning the "<br/>" into
  part of the link.
  
  bug 6195 -- URLs included in templated pages are broken
  
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.263 loncom/interface/lonhtmlcommon.pm:1.264
--- loncom/interface/lonhtmlcommon.pm:1.263	Mon Jan 25 19:16:08 2010
+++ loncom/interface/lonhtmlcommon.pm	Tue Jan 26 05:22:03 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.263 2010/01/25 19:16:08 faziophi Exp $
+# $Id: lonhtmlcommon.pm,v 1.264 2010/01/26 05:22:03 faziophi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -74,7 +74,7 @@
 
 sub raw_href_to_link {
    my ($message)=@_;
-   $message=~s/(https?\:\/\/[^\s\'\"]+)(\s|$)/<a href="$1"><tt>$1<\/tt><\/a>$2/gi;
+   $message=~s/(https?\:\/\/[^\s\'\"\<]+)([\s\<]|$)/<a href="$1"><tt>$1<\/tt><\/a>$2/gi;
    return $message;
 }