--- rat/lonratedt.pm 2006/12/20 22:42:48 1.86 +++ rat/lonratedt.pm 2007/01/16 21:10:55 1.87 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Edit Handler for RAT Maps # -# $Id: lonratedt.pm,v 1.86 2006/12/20 22:42:48 albertel Exp $ +# $Id: lonratedt.pm,v 1.87 2007/01/16 21:10:55 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -173,7 +173,7 @@ use Apache::lonlocal; use LONCAPA::map(); use File::Copy; use LONCAPA; - +use HTML::Entities(); # --------------------------------------------------------- Build up RAT screen sub ratedt { @@ -602,10 +602,12 @@ sub smpedt { my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$_]); unless ($name) { $name=(split(/\//,$url))[-1]; } unless ($name) { $name='EMPTY'; } + $name = &LONCAPA::map::qtescape($name); + $url = &LONCAPA::map::qtescape($url); $targetdetail.='&'.&escape($name).'='. &escape($url); $idx++; - $name=~s/\:/\:/g; + $name = &HTML::Entities::encode($name,'\'"<>&'); ''; } @LONCAPA::map::order); @@ -642,8 +644,6 @@ sub smpedt { function openview(entry) { var url=unescape((entry.split('='))[1]); var parts=new Array; - parts=url.split(':'); - url=parts.join(':'); if (url) { open(url,'cat'); } } @@ -662,12 +662,6 @@ sub smpedt { var entry=(document.forms.simpleedit.targetdetail.value.split('&')) [selidx]; var oldname=unescape((entry.split('='))[0]); - var nameparts=oldname.split(':'); - oldname=unescape(nameparts.join(':')); - nameparts=oldname.split('"'); - oldname=unescape(nameparts.join('"')); - nameparts=oldname.split('''); - oldname=unescape(nameparts.join("'")); newtitle=prompt('$lt{'nt'}',oldname); if (newtitle) { document.forms.simpleedit.renameres.value=1; @@ -800,11 +794,11 @@ sub viewmap { $idx++; my ($title,$url,$cond)=split(/\:/,$_); if ($cond eq 'cond') { next; } - $title=~s/\&colon\;/\:/g; - $url=~s/\&colon\;/\:/g; + $title= &LONCAPA::map::qtescape($title); + $url = &LONCAPA::map::qtescape($url); unless ($title) { $title=(split(/\//,$url))[-1] }; unless ($title) { $title=''.&mt('Empty').''; } - my $resurl = &LONCAPA::map::qtescape($url); + my $resurl = $url; my $resfilepath = $Apache::lonnet::perlvar{'lonDocRoot'}.$resurl; my $filename; if ($resurl =~ m#/([^/]+)$#) { @@ -815,7 +809,7 @@ sub viewmap { my $bgcol = $idx%2; $r->print('