--- loncom/auth/lonacc.pm 2007/11/06 02:26:07 1.112 +++ loncom/auth/lonacc.pm 2007/11/06 02:42:40 1.113 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.112 2007/11/06 02:26:07 albertel Exp $ +# $Id: lonacc.pm,v 1.113 2007/11/06 02:42:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -63,7 +63,8 @@ sub get_posted_cgi { 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) { @@ -75,7 +76,7 @@ sub get_posted_cgi { &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=''; @@ -83,7 +84,7 @@ sub get_posted_cgi { my $fmime=''; my $i; for ($i=0;$i<=$#lines;$i++) { - if ($lines[$i]=~/^\Q$contentsep\E/) { + if ($lines[$i]=~/^--\Q$contentsep\E/) { if ($name) { chomp($value); if ($fname) {