[LON-CAPA-cvs] cvs: rat / lonuserstate.pm
www
lon-capa-cvs@mail.lon-capa.org
Wed, 05 Jun 2002 12:52:05 -0000
www Wed Jun 5 08:52:05 2002 EDT
Modified files:
/rat lonuserstate.pm
Log:
Bug 500.
Pipe symbol was interpreted as "or" in the regular expression that added
additional conditions to the access of a resource. Only occured if a resource
appeared at least three times.
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.26 rat/lonuserstate.pm:1.27
--- rat/lonuserstate.pm:1.26 Sun Dec 16 19:57:59 2001
+++ rat/lonuserstate.pm Wed Jun 5 08:52:05 2002
@@ -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.26 2001/12/17 00:57:59 harris41 Exp $
+# $Id: lonuserstate.pm,v 1.27 2002/06/05 12:52:05 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -370,8 +370,10 @@
if ($acchash{'acc.res.'.$short.'.'.$uripath}=~
/(\&$urifile\:[^\&]*)/) {
my $replace=$1;
+ my $regexp=$replace;
+ $regexp=~s/\|/\\\|/g;
$acchash{'acc.res.'.$short.'.'.$uripath}
- =~s/$replace/$replace\|$uricond/;
+ =~s/$regexp/$replace\|$uricond/;
} else {
$acchash{'acc.res.'.$short.'.'.$uripath}.=
$urifile.':'.$uricond.'&';