[LON-CAPA-cvs] cvs: loncom / lonenc.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Fri, 08 Dec 2006 22:04:58 -0000


raeburn		Fri Dec  8 17:04:58 2006 EDT

  Modified files:              
    /loncom	lonenc.pm 
  Log:
  &check_encrypt() now accepts a reference to a scalar  - i.e, the same as check_decrypt().      
  
  
Index: loncom/lonenc.pm
diff -u loncom/lonenc.pm:1.17 loncom/lonenc.pm:1.18
--- loncom/lonenc.pm:1.17	Thu Sep 28 16:47:13 2006
+++ loncom/lonenc.pm	Fri Dec  8 17:04:57 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # URL translation for encrypted filenames
 #
-# $Id: lonenc.pm,v 1.17 2006/09/28 20:47:13 albertel Exp $
+# $Id: lonenc.pm,v 1.18 2006/12/08 22:04:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -109,7 +109,12 @@
 
 sub check_encrypt {
     my $str=shift;
-    if ($env{'request.enc'}) { return &Apache::lonenc::encrypted($str); }
+    if (ref($str)) {
+        if ($env{'request.enc'}) { $$str = &Apache::lonenc::encrypted($$str); }
+        return;
+    } else {
+        if ($env{'request.enc'}) { return &Apache::lonenc::encrypted($str); }
+    }
     return $str;
 }