[interchange-cvs] interchange - jon modified lib/Vend/Server.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Wed Mar 26 09:19:35 EST 2008
User: jon
Date: 2008-03-26 14:19:35 GMT
Modified: lib/Vend Server.pm
Log:
Fix overly-tight MIME type matching.
Match on end of MIME type boundary with \b instead of end of string, since a
boundary or other things can follow.
Match case-insensitively in several places since MIME types are not
case-sensitive.
Match on word boundaries in a few places.
Revision Changes Path
2.90 interchange/lib/Vend/Server.pm
rev 2.90, prev_rev 2.89
Index: Server.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Server.pm,v
retrieving revision 2.89
retrieving revision 2.90
diff -u -u -r2.89 -r2.90
--- Server.pm 25 Mar 2008 17:13:21 -0000 2.89
+++ Server.pm 26 Mar 2008 14:19:35 -0000 2.90
@@ -1,6 +1,6 @@
# Vend::Server - Listen for Interchange CGI requests as a background server
#
-# $Id: Server.pm,v 2.89 2008-03-25 17:13:21 jon Exp $
+# $Id: Server.pm,v 2.90 2008-03-26 14:19:35 jon Exp $
#
# Copyright (C) 2002-2008 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -26,7 +26,7 @@
package Vend::Server;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.89 $, 10);
+$VERSION = substr(q$Revision: 2.90 $, 10);
use Cwd;
use POSIX qw(setsid strftime);
@@ -251,7 +251,7 @@
if ($request_method eq 'POST') {
#::logDebug("content type header: " . $CGI::content_type);
## check for valid content type
- if ($CGI::content_type =~ m{^(?:multipart/form-data|application/x-www-form-urlencoded)$}) {
+ if ($CGI::content_type =~ m{^(?:multipart/form-data|application/x-www-form-urlencoded)\b}i) {
parse_post(\$CGI::query_string)
if $Global::TolerateGet;
parse_post($h->{entity});
@@ -332,7 +332,7 @@
my (@pairs, $pair, $key, $value, $charset);
- if ($CGI::content_type =~ m/charset=(["']?)([-a-zA-Z0-9]+)\1/) {
+ if ($CGI::content_type =~ m/\bcharset=(["']?)([-a-zA-Z0-9]+)\1/i) {
$charset = $2;
}
else {
@@ -341,13 +341,13 @@
$CGI::values{mv_form_charset} = $charset;
- if ($CGI::content_type =~ /^multipart/i) {
+ if ($CGI::content_type =~ m{^multipart/}i) {
return parse_multipart($sref) if $CGI::useragent !~ /MSIE\s+5/i;
# try and work around an apparent IE5 bug that sends the content type
# of the next POST after a multipart/form POST as multipart also -
# even though it's sent as non-multipart data
# Contributed by Bill Randle
- my ($boundary) = $CGI::content_type =~ /boundary=\"?([^\";]+)\"?/;
+ my ($boundary) = $CGI::content_type =~ /\bboundary="?([^";]+)"?/i;
$boundary = '--' . quotemeta $boundary;
return parse_multipart($sref) if $$sref =~ /^\s*$boundary\s+/;
}
@@ -465,7 +465,7 @@
$content_type ||= 'text/plain';
$charset ||= Vend::CharSet->default_charset();
- if ($content_type =~ m{^text/}) {
+ if ($content_type =~ m{^text/}i) {
$data = Vend::CharSet->to_internal($charset, $data);
}
More information about the interchange-cvs
mailing list