--- loncom/interface/londocs.pm 2007/01/09 19:10:46 1.269 +++ loncom/interface/londocs.pm 2007/01/26 23:37:53 1.270 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.269 2007/01/09 19:10:46 albertel Exp $ +# $Id: londocs.pm,v 1.270 2007/01/26 23:37:53 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -235,7 +235,6 @@ sub dumpcourse { my ($ext)=($_=~/\.(\w+)$/); my $title=$hash{'title_'.$hash{ 'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}}; - $title=~s/:/:/g; $r->print(''.($title?$title:' ').''); if (!$title) { $title=$_; @@ -937,8 +936,8 @@ sub group_import { $LONCAPA::map::order[$#LONCAPA::map::order+1]=$idx; my $ext = 'false'; if ($url=~m{^http://} || $url=~m{^https://}) { $ext = 'true'; } - $url =~ s/:/\:/g; - $name =~ s/:/\:/g; + $url =~ &LONCAPA::map::qtunescape($url); + $name =~ &LONCAPA::map::qtunescape($name); $LONCAPA::map::resources[$idx] = join ':', ($name, $url, $ext, 'normal', 'res'); } @@ -1316,12 +1315,10 @@ sub editor { &Apache::lonnet::getfile($url)); $url=$newurl; } - $title=~s/\/\>\;/g; - $title=~s/\:/\:/g; + $title = &LONCAPA::map::qtunescape($title); my $ext='false'; if ($url=~/^http\:\/\//) { $ext='true'; } - $url=~s/\:/\:/g; + $url = &LONCAPA::map::qtunescape($url); # Now insert the URL at the bottom my $newidx=&LONCAPA::map::getresidx($url); $LONCAPA::map::resources[$newidx]= @@ -1373,19 +1370,14 @@ sub editor { my $ratstr = $LONCAPA::map::resources[$LONCAPA::map::order[$idx]]; my ($rtitle,@rrest)=split(/\:/, $LONCAPA::map::resources[$LONCAPA::map::order[$idx]]); - my $comment= - &HTML::Entities::decode($env{'form.title'}); - $comment=~s/\/\>\;/g; - $comment=~s/\:/\:/g; + my $comment=$env{'form.title'}; + $comment = &LONCAPA::map::qtunescape($comment); if ($comment=~/\S/) { $LONCAPA::map::resources[$LONCAPA::map::order[$idx]]= $comment.':'.join(':',@rrest); } # Devalidate title cache - my $renamed_url=$rrest[0]; -# Has the :-escaping - $renamed_url=~s/\&colon\;/\:/g; + my $renamed_url=&LONCAPA::map::qtescape($rrest[0]); &Apache::lonnet::devalidate_title_cache($renamed_url); } # Store the changed version @@ -1456,7 +1448,7 @@ sub editor { foreach (@LONCAPA::map::order) { my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$_]); $name=&LONCAPA::map::qtescape($name); - $url=&LONCAPA::map::qtescape($url); + $url =&LONCAPA::map::qtescape($url); unless ($name) { $name=(split(/\//,$url))[-1]; } unless ($name) { $idx++; next; } $r->print(&entryline($idx,$name,$url,$folder,$allowed,$_,$coursenum)); @@ -1539,11 +1531,9 @@ sub process_file_upload { $codebase); my $ext='false'; if ($url=~/^http\:\/\//) { $ext='true'; } - $url=~s/\:/\:/g; + $url = &LONCAPA::map::qtunescape($url); my $comment=$env{'form.comment'}; - $comment=~s/\/\>\;/g; - $comment=~s/\:/\:/g; + $comment = &LONCAPA::map::qtunescape($comment); if ($folder=~/^supplemental/) { $comment=time.'___&&&___'.$env{'user.name'}.'___&&&___'. $env{'user.domain'}.'___&&&___'.$comment; @@ -1641,9 +1631,7 @@ sub process_secondary_uploads { sub entryline { my ($index,$title,$url,$folder,$allowed,$residx,$coursenum)=@_; - $title=~s/\&colon\;/\:/g; - $title=&HTML::Entities::encode(&HTML::Entities::decode( - &unescape($title)),'"<>&\''); + $title=&HTML::Entities::encode($title,'"<>&\''); my $renametitle=$title; my $foldertitle=$title; my $pagetitle=$title;