[LON-CAPA-cvs] cvs: loncom(version_2_5_X) /auth lonacc.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 06 Nov 2007 18:07:37 -0000


albertel		Tue Nov  6 13:07:37 2007 EDT

  Modified files:              (Branch: version_2_5_X)
    /loncom/auth	lonacc.pm 
  Log:
  - backport 1.112, 1.113
  
  
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.110 loncom/auth/lonacc.pm:1.110.2.1
--- loncom/auth/lonacc.pm:1.110	Fri Apr 27 18:03:02 2007
+++ loncom/auth/lonacc.pm	Tue Nov  6 13:07:35 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.110 2007/04/27 22:03:02 banghart Exp $
+# $Id: lonacc.pm,v 1.110.2.1 2007/11/06 18:07:35 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -64,7 +64,8 @@
     if ($r->header_in('Content-length')) {
 	$r->read($buffer,$r->header_in('Content-length'),0);
     }
-    unless ($buffer=~/^(\-+\w+)\s+Content\-Disposition\:\s*form\-data/si) {
+    my $content_type = $r->header_in('Content-type');
+    if ($content_type !~ m{^multipart/form-data}) {
 	my @pairs=split(/&/,$buffer);
 	my $pair;
 	foreach $pair (@pairs) {
@@ -76,7 +77,7 @@
 	    &Apache::loncommon::add_to_env("form.$name",$value);
 	}
     } else {
-	my $contentsep=$1;
+	my ($contentsep) = ($content_type =~ /boundary=\"?([^\";,]+)\"?/);
 	my @lines = split (/\n/,$buffer);
 	my $name='';
 	my $value='';
@@ -84,7 +85,7 @@
 	my $fmime='';
 	my $i;
 	for ($i=0;$i<=$#lines;$i++) {
-	    if ($lines[$i]=~/^$contentsep/) {
+	    if ($lines[$i]=~/^--\Q$contentsep\E/) {
 		if ($name) {
 		    chomp($value);
 		    if ($fname) {