--- rat/lonwrapper.pm 2020/05/22 23:54:42 1.49.2.4.4.2 +++ rat/lonwrapper.pm 2017/11/30 14:41:30 1.65 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Wrapper for external and binary files as standalone resources # -# $Id: lonwrapper.pm,v 1.49.2.4.4.2 2020/05/22 23:54:42 raeburn Exp $ +# $Id: lonwrapper.pm,v 1.65 2017/11/30 14:41:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,7 +37,9 @@ use Apache::lonlocal; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonextresedit(); +use Apache::lonexttool(); use LONCAPA qw(:DEFAULT :match); +use HTML::Entities(); # ================================================================ Main Handler sub wrapper { @@ -48,7 +50,6 @@ sub wrapper { unless ($env{'form.folderpath'}) { $forcereg = 1; } - my %lt = &Apache::lonlocal::texthash( 'noif' => 'No iframe support.', 'show' => 'Show content in pop-up window', @@ -83,7 +84,7 @@ sub wrapper { my $startpage = &Apache::loncommon::start_page('Menu',undef,$args); my $endpage = &Apache::loncommon::end_page(); - + if (($env{'browser.mobile'}) || ($exttool eq 'window') || ($exttool eq 'tab')) { my $output = $startpage; if ($is_pdf) { @@ -104,6 +105,7 @@ sub wrapper { if ($linktext eq '') { $linktext = &mt('Launch External Tool'); } + $url = &HTML::Entities::encode($url,'"<>&'); if ($exttool eq 'tab') { $output .= '
'. ''. @@ -113,9 +115,9 @@ sub wrapper { $output .= <<"ENDLINK";