[interchange-cvs] interchange - jon modified lib/Vend/Interpolate.pm
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Thu Jun 6 11:59:00 2002
User: jon
Date: 2002-06-06 15:58:35 GMT
Modified: lib/Vend Interpolate.pm
Log:
Allow any parameter names (including \W chars.) in links,
since they are valid URLs and Interchange properly unescapes them
on the way in. (CGI names 'some-var' or even 'some%var' should be
possible, even if discouraged.)
Allow creation of a link for a page called '0' (perhaps for a strange
flypage for sku '0'?).
Allow mv_arg to have value '0' in links as well.
Revision Changes Path
2.66 +5 -6 interchange/lib/Vend/Interpolate.pm
rev 2.66, prev_rev 2.65
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.65
retrieving revision 2.66
diff -u -u -r2.65 -r2.66
--- Interpolate.pm 29 May 2002 05:01:05 -0000 2.65
+++ Interpolate.pm 6 Jun 2002 15:58:35 -0000 2.66
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#
-# $Id: Interpolate.pm,v 2.65 2002/05/29 05:01:05 kwalsh Exp $
+# $Id: Interpolate.pm,v 2.66 2002/06/06 15:58:35 jon Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
@@ -27,7 +27,7 @@
require Exporter;
@ISA = qw(Exporter);
-$VERSION = substr(q$Revision: 2.65 $, 10);
+$VERSION = substr(q$Revision: 2.66 $, 10);
@EXPORT = qw (
@@ -2861,7 +2861,7 @@
for(@args) {
next if /^[\w=]+$/;
s!\0!-_NULL_-!g;
- s!(\w=)(.*)!$1 . esc($2)!eg
+ s!([^=]+)=(.*)!esc($1) . '=' . esc($2)!eg
or (undef $_, next);
}
return join $Global::UrlJoiner, grep length($_), @args;
@@ -2916,7 +2916,7 @@
$opt->{form} = $form;
}
- $href = 'process' unless $href;
+ $href = 'process' unless length($href);
$href =~ s:^/+::;
$opt->{secure} = 1 if exists $Vend::Cfg->{AlwaysSecure}{$href};
my $base = ! $opt->{secure} ? ($Vend::Cfg->{VendURL}) : $Vend::Cfg->{SecureURL};
@@ -2927,8 +2927,7 @@
unless $::Scratch->{mv_force_cache};
$extra .= "mv_pc=" . ++$Vend::Session->{pageCount} . "\n"
unless $::Scratch->{mv_force_cache};
- $arg = '' if ! $arg;
- $arg = "mv_arg=$arg\n" if $arg && $arg !~ /\n/;
+ $arg = "mv_arg=$arg\n" if length($arg) && $arg !~ /\n/;
$extra .= $arg . $opt->{form};
return $href . '?' . escape_form($extra);
}