--- rat/lonuserstate.pm 2022/10/04 20:39:57 1.169 +++ rat/lonuserstate.pm 2022/10/05 16:11:25 1.170 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construct and maintain state and binary representation of course for user # -# $Id: lonuserstate.pm,v 1.169 2022/10/04 20:39:57 raeburn Exp $ +# $Id: lonuserstate.pm,v 1.170 2022/10/05 16:11:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -504,6 +504,8 @@ sub error_detail { } else { $errinfo .= &mt('To rectify this problem, create and publish the missing file'); } + my $fileurl = $uri; + $fileurl =~s{^/res/}{/priv/}; if ($fileswitch) { my $rolename = &Apache::lonnet::plaintext($filerole); my $rolecode; @@ -513,10 +515,10 @@ sub error_detail { $rolecode = $filerole.'./'.$audomfile.'/'.$aunamefile; } $errinfo .= '.
'.&mt('You will need to [_1]switch server[_2].', - '',''); + '',''); } else { - my $fileurl = $uri; - $fileurl =~s{^/res/}{/priv/}; + &js_escape(\$fileurl); $errinfo .= ': '.&mt('Create the missing file').''; } } @@ -537,18 +539,20 @@ sub error_detail { } else { $errinfo .= &mt('To rectify this problem edit the parent map to remove the reference to the missing file'); } + my $mapurl = $hash{'map_id_'.$parent_pc}; + $mapurl =~s{^/res/}{/priv/}; if ($switchserver) { $errinfo .= '.
'; if ((&Apache::lonnet::will_trust('othcoau',$env{'user.domain'},$audom)) && (&Apache::lonnet::will_trust('coaurem',$audom,$env{'user.domain'}))) { $errinfo .= &mt('You will need to [_1]switch server[_2].', - '',''); + '',''); } else { $errinfo .= &mt('Session switch required but prohibited.'); } } else { - my $mapurl = $hash{'map_id_'.$parent_pc}; - $mapurl =~s{^/res/}{/priv/}; + &js_escape(\$mapurl); $errinfo .= ': '.&mt('Edit the map').''; } } elsif ($uploaded && $courseid) {