[interchange-cvs] interchange - kwalsh modified lib/Vend/Server.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Tue May 14 07:50:00 2002


User:      kwalsh
Date:      2002-05-14 11:49:34 GMT
Modified:  lib/Vend Server.pm
Log:
	* Modified the previous "CGI mapping error" patch to use the
	  existing quotemeta facility, rather than the \W substitution.

Revision  Changes    Path
2.5       +4 -5      interchange/lib/Vend/Server.pm


rev 2.5, prev_rev 2.4
Index: Server.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Server.pm,v
retrieving revision 2.4
retrieving revision 2.5
diff -u -r2.4 -r2.5
--- Server.pm	10 May 2002 18:29:00 -0000	2.4
+++ Server.pm	14 May 2002 11:49:34 -0000	2.5
@@ -1,6 +1,6 @@
 # Vend::Server - Listen for Interchange CGI requests as a background server
 #
-# $Id: Server.pm,v 2.4 2002/05/10 18:29:00 kwalsh Exp $
+# $Id: Server.pm,v 2.5 2002/05/14 11:49:34 kwalsh Exp $
 #
 # Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -25,7 +25,7 @@
 package Vend::Server;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.4 $, 10);
+$VERSION = substr(q$Revision: 2.5 $, 10);
 
 use POSIX qw(setsid strftime);
 use Vend::Util;
@@ -226,8 +226,7 @@
 		# even though it's sent as non-multipart data
 		# Contributed by Bill Randle
 		my ($boundary) = $CGI::content_type =~ /boundary=\"?([^\";]+)\"?/;
-		$boundary =~ s/(\W)/\\$1/g;
-		$boundary = "--$boundary";
+		$boundary = '--' . quotemeta $boundary;
 		return parse_multipart($sref) if $$sref =~ /^\s*$boundary\s+/;
 	}
 	@pairs = split($Global::UrlSplittor, $$sref);
@@ -297,7 +296,7 @@
 sub parse_multipart {
 	my $sref = shift;
 	my ($boundary) = $CGI::content_type =~ /boundary=\"?([^\";]+)\"?/;
-	$boundary =~ s/(\W)/\\$1/g;
+	$boundary = quotemeta $boundary;
 #::logDebug("got to multipart");
 	# Stolen from CGI.pm, thanks Lincoln
 	$boundary = "--$boundary"