[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

raeburn raeburn at source.lon-capa.org
Sun Aug 24 19:38:30 EDT 2014


raeburn		Sun Aug 24 23:38:30 2014 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  - No need to add an extlink or encrypt the src attribute (if urlhidden active)
    in cases where image data are included directly in <img> tag's src attribute
    using a "data URI".
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.452 loncom/xml/londefdef.pm:1.453
--- loncom/xml/londefdef.pm:1.452	Tue Jun 17 23:22:17 2014
+++ loncom/xml/londefdef.pm	Sun Aug 24 23:38:30 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.452 2014/06/17 23:22:17 raeburn Exp $
+# $Id: londefdef.pm,v 1.453 2014/08/24 23:38:30 raeburn Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -2753,7 +2753,9 @@
 	my $inside = &Apache::lonxml::get_all_text("/img",$parser,$style);
 	return '';
     }
-    &Apache::lonxml::extlink($src);
+    unless ($src =~ m{^data\:image/gif;base64,}) {
+        &Apache::lonxml::extlink($src);
+    }
     my $currentstring = '';
     my $scaling = .3;
 
@@ -2763,8 +2765,10 @@
         my $enc = ('yes' eq 
                    lc(&Apache::lonxml::get_param('encrypturl',$parstack,
                       $safeeval)));
-        $currentstring.=&Apache::lonenc::encrypt_ref($token,{'src'=>$src},
-                         $enc);
+        unless ($src =~ m{^data\:image/gif;base64,}) {
+            $currentstring.=&Apache::lonenc::encrypt_ref($token,{'src'=>$src},
+                            $enc);
+        }
 
     # and render unto TeX that which is LaTeX
     } elsif ($target eq 'tex') {




More information about the LON-CAPA-cvs mailing list