[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
bowersj2
lon-capa-cvs@mail.lon-capa.org
Tue, 01 Oct 2002 19:09:27 -0000
bowersj2 Tue Oct 1 15:09:27 2002 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
- Blows up when you have maps with ( or ) or { or } or other special chars
- \E might still be an issue.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.288 loncom/lonnet/perl/lonnet.pm:1.289
--- loncom/lonnet/perl/lonnet.pm:1.288 Tue Oct 1 03:59:33 2002
+++ loncom/lonnet/perl/lonnet.pm Tue Oct 1 15:09:27 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.288 2002/10/01 07:59:33 albertel Exp $
+# $Id: lonnet.pm,v 1.289 2002/10/01 19:09:27 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1986,14 +1986,15 @@
my @uriparts=split(/\//,$uri);
my $filename=$uriparts[$#uriparts];
my $pathname=$uri;
- $pathname=~s/\/$filename$//;
+ $pathname=~s|/\Q$filename\E$||;
+ #Trying to find the conditional for the file
my $match=($ENV{'acc.res.'.$ENV{'request.course.id'}.'.'.$pathname}=~
- /\&$filename\:([\d\|]+)\&/);
+ /\&\Q$filename\E\:([\d\|]+)\&/);
if ($match) {
- return (1,$1);
- } else {
- return (0,0);
- }
+ return (1,$1);
+ } else {
+ return (0,0);
+ }
}
# ----------------------------------------------------------------- Define Role