--- rat/lonwrapper.pm 2017/05/10 13:49:21 1.63 +++ rat/lonwrapper.pm 2017/05/10 19:25:28 1.64 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Wrapper for external and binary files as standalone resources # -# $Id: lonwrapper.pm,v 1.63 2017/05/10 13:49:21 raeburn Exp $ +# $Id: lonwrapper.pm,v 1.64 2017/05/10 19:25:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,7 +38,8 @@ use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonextresedit(); use Apache::lonexttool(); -use LONCAPA qw(:DEFAULT :match);; +use LONCAPA qw(:DEFAULT :match); +use HTML::Entities(); # ================================================================ Main Handler sub wrapper { @@ -104,6 +105,7 @@ sub wrapper { if ($linktext eq '') { $linktext = &mt('Launch External Tool'); } + $url = &HTML::Entities::encode($url,'"<>&'); if ($exttool eq 'tab') { $output .= '
'. ''. @@ -112,6 +114,7 @@ sub wrapper { } else { $output .= <<"ENDLINK";
@@ -139,8 +143,9 @@ ENDLINK $output .= '
'.$explanation.'
'; } } else { + my $dest = &HTML::Entities::encode($url.$anchor,'&<>"'); $output .= '
'."\n". - '\n". "
\n"; @@ -179,11 +184,12 @@ ENDLINK window.onload = function(){ \$(window).trigger('resize') }; SCRIPT # javascript will position the iframe if window was resized (or zoomed) + my $dest = &HTML::Entities::encode($url.$anchor,'&<>"'); return < - +
$endpage ENDFRAME @@ -339,7 +345,7 @@ described at http://www.lon-capa.org. =over -=item wrapper($url,$brcrum,$absolute,$is_ext,$is_pdf,$title)) +=item wrapper($url,$brcrum,$absolute,$is_ext,$is_pdf,$linktext,$explanation,$title,$width,$height) =over