User: markj
Date: 2009-03-27 11:09:48 GMT
Modified: lib/Vend Config.pm Server.pm
Log:
* New DowncaseVarname config. Given a space- or comma-delimited list of CGI
params, Interchange will accept those params in any case from the query
string and force them to lower case. Developed primarily to address affliates
creating URLs with "mv_pc" but using inconsistent case in the URL, and thus
Interchange missing it.
Revision Changes Path
2.244 interchange/lib/Vend/Config.pm
rev 2.244, prev_rev 2.243
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.243
retrieving revision 2.244
diff -u -r2.243 -r2.244
--- Config.pm 22 Mar 2009 19:32:31 -0000 2.243
+++ Config.pm 27 Mar 2009 11:09:48 -0000 2.244
@@ -1,6 +1,6 @@
# Vend::Config - Configure Interchange
#
-# $Id: Config.pm,v 2.243 2009-03-22 19:32:31 mheins Exp $
+# $Id: Config.pm,v 2.244 2009-03-27 11:09:48 markj Exp $
#
# Copyright (C) 2002-2009 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -54,7 +54,7 @@
use Vend::Data;
use Vend::Cron;
-$VERSION = substr(q$Revision: 2.243 $, 10);
+$VERSION = substr(q$Revision: 2.244 $, 10);
my %CDname;
my %CPname;
@@ -518,6 +518,7 @@
['External', 'yesno', 'No'],
['ExternalFile', 'root_dir', "$Global::RunDir/external.structure"],
['ExternalExport', undef, 'Global::Catalog=Catalog'],
+ ['DowncaseVarname', undef, ''],
];
return $directives;
2.104 interchange/lib/Vend/Server.pm
rev 2.104, prev_rev 2.103
Index: Server.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Server.pm,v
retrieving revision 2.103
retrieving revision 2.104
diff -u -r2.103 -r2.104
--- Server.pm 22 Mar 2009 19:32:31 -0000 2.103
+++ Server.pm 27 Mar 2009 11:09:48 -0000 2.104
@@ -1,6 +1,6 @@
# Vend::Server - Listen for Interchange CGI requests as a background server
#
-# $Id: Server.pm,v 2.103 2009-03-22 19:32:31 mheins Exp $
+# $Id: Server.pm,v 2.104 2009-03-27 11:09:48 markj Exp $
#
# Copyright (C) 2002-2009 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.103 $, 10);
+$VERSION = substr(q$Revision: 2.104 $, 10);
use Cwd;
use POSIX qw(setsid strftime);
@@ -315,6 +315,11 @@
# Doesn't do unhexify
sub store_cgi_kv {
my ($key, $value) = @_;
+
+ $key = lc ($key) if
+ $Global::DowncaseVarname
+ && $Global::DowncaseVarname =~ /\b$key\b/i;
+
$key = $::IV->{$key} if defined $::IV->{$key};
if(defined $CGI::values{$key} and ! defined $::SV{$key}) {
$CGI::values{$key} = "$CGI::values{$key}\0$value";
@@ -383,6 +388,10 @@
};
#::logDebug("incoming --> $key");
+ $key = lc ($key) if
+ $Global::DowncaseVarname
+ && $Global::DowncaseVarname =~ /\b$key\b/i;
+
$key = $::IV->{$key} if defined $::IV->{$key};
Vend::CharSet::decode_urlencode(\$key, $charset);
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.