Skip to content

Commit

Permalink
* Fix link generation options so that $opt->{no_session_id} and
Browse files Browse the repository at this point in the history
  $Scratch->{mv_no_session_id} work as they should.

* Make sure unwanted form params don't show up when using form=auto.
  • Loading branch information
perusionmike committed Jan 2, 2003
1 parent 295fd7c commit 7b377c1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/Vend/Util.pm
@@ -1,6 +1,6 @@
# Vend::Util - Interchange utility functions # Vend::Util - Interchange utility functions
# #
# $Id: Util.pm,v 2.44 2002-12-18 19:54:52 mheins Exp $ # $Id: Util.pm,v 2.45 2003-01-02 23:27:07 mheins Exp $
# #
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com> # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
# #
Expand Down Expand Up @@ -85,7 +85,7 @@ require HTML::Entities;
use Safe; use Safe;
use subs qw(logError logGlobal); use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK); use vars qw($VERSION @EXPORT @EXPORT_OK);
$VERSION = substr(q$Revision: 2.44 $, 10); $VERSION = substr(q$Revision: 2.45 $, 10);


BEGIN { BEGIN {
eval { eval {
Expand Down Expand Up @@ -1240,8 +1240,6 @@ my @scratches = qw/
add_source add_source
link_relative link_relative
match_security match_security
no_count
no_session_id
/; /;


sub vendUrl { sub vendUrl {
Expand All @@ -1258,19 +1256,20 @@ sub vendUrl {
} }


$opt ||= {}; $opt ||= {};
my %skip = qw/form 1 href 1 reparse 1/;

for(@scratches) { for(@scratches) {
next if defined $opt->{$_}; next if defined $opt->{$_};
my $mvparm = "mv_$_"; next unless defined $::Scratch->{"mv_$_"};
next unless $::Scratch->{$mvparm}; $skip{$_} = 1;
$opt->{$_} = $::Scratch->{$mvparm}; $opt->{$_} = $::Scratch->{"mv_$_"};
} }


my $extra; my $extra;
if($opt->{form}) { if($opt->{form}) {
$path = 'process' unless $path; $path = 'process' unless $path;
if($opt->{form} eq 'auto') { if($opt->{form} eq 'auto') {
my $form = ''; my $form = '';
my %skip = qw/form 1 href 1 reparse 1/;
while( my ($k, $v) = each %$opt) { while( my ($k, $v) = each %$opt) {
next if $skip{$k}; next if $skip{$k};
$k =~ s/^__//; $k =~ s/^__//;
Expand All @@ -1283,9 +1282,10 @@ sub vendUrl {


my($id, $ct); my($id, $ct);
$id = $Vend::SessionID $id = $Vend::SessionID
unless $opt->{no_session_id} or ($can_cache and $Vend::Cookie); unless $opt->{no_session_id}
or ($Vend::Cookie and $can_cache and $::Scratch->{mv_no_session_id});
$ct = ++$Vend::Session->{pageCount} $ct = ++$Vend::Session->{pageCount}
unless $opt->{no_count} or $can_cache; unless $opt->{no_count} or ($can_cache && $::Scratch->{mv_no_count});


if($opt->{match_security}) { if($opt->{match_security}) {
$opt->{secure} = $CGI::secure; $opt->{secure} = $CGI::secure;
Expand Down

0 comments on commit 7b377c1

Please sign in to comment.