[LON-CAPA-cvs] cvs: rat / lonuserstate.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 02 Feb 2004 00:46:51 -0000


www		Sun Feb  1 19:46:51 2004 EDT

  Modified files:              
    /rat	lonuserstate.pm 
  Log:
  Bug #2381: External URLs with query string work now. Bighash's ids now do
  not have query strings anymore.
  
  
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.70 rat/lonuserstate.pm:1.71
--- rat/lonuserstate.pm:1.70	Mon Dec 15 10:49:23 2003
+++ rat/lonuserstate.pm	Sun Feb  1 19:46:51 2004
@@ -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.70 2003/12/15 15:49:23 www Exp $
+# $Id: lonuserstate.pm,v 1.71 2004/02/02 00:46:51 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -172,11 +172,13 @@
 			    }
                         }
 		    }
-
-                    if (defined($hash{'ids_'.$turi})) {
-                        $hash{'ids_'.$turi}.=','.$rid;
+# Store reverse lookup, remove query string
+		    my $idsuri=$turi;
+		    $idsuri=~s/\?.+$//;
+                    if (defined($hash{'ids_'.$idsuri})) {
+                        $hash{'ids_'.$idsuri}.=','.$rid;
                     } else {
-                        $hash{'ids_'.$turi}=''.$rid;
+                        $hash{'ids_'.$idsuri}=''.$rid;
                     }
                
                     if