--- loncom/interface/londocs.pm 2023/10/06 14:21:05 1.484.2.93.2.16 +++ loncom/interface/londocs.pm 2023/12/30 05:25:31 1.484.2.93.2.17 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.484.2.93.2.16 2023/10/06 14:21:05 raeburn Exp $ +# $Id: londocs.pm,v 1.484.2.93.2.17 2023/12/30 05:25:31 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4605,7 +4605,7 @@ END $nomodal = 1; } } - my ($checkencrypt,$shownurl); + my $checkencrypt; if (!$env{'request.role.adv'}) { if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) || ($isencrypted) || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) { @@ -4625,7 +4625,7 @@ END my $currenc = $env{'request.enc'}; $env{'request.enc'} = 1; $shownsymb = &Apache::lonenc::encrypted($symb); - $shownurl = &Apache::lonenc::encrypted($url); + my $shownurl = &Apache::lonenc::encrypted($url); if (&Apache::lonnet::symbverify($symb,$url)) { $url = $shownurl; } else { @@ -4640,7 +4640,8 @@ END $url = &Apache::lonnet::clutter($url); } } - $shownurl = $url; + } else { + $url = ''; } unless ($env{'request.role.adv'}) { if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { @@ -4651,8 +4652,8 @@ END $hiddenres = 1; } } - if ($url ne '') { - $url = $shownurl.(($shownurl=~/\?/)?'&':'?').'symb='.&escape($shownsymb); + if (($url ne '') && ($shownsymb ne '')) { + $url .= (($url=~/\?/)?'&':'?').'symb='.&escape($shownsymb); } } } elsif ($supplementalflag) {