Permalink
Browse files

Strip bad characters from affiliate source.

Strip bad characters from affiliate source.  These characters cause problems in
the usertrack log (and possibly other places) if they are allowed to remain in
the source.
  • Loading branch information...
pajamian committed Feb 5, 2011
1 parent bef0ecf commit 50f9e7c76eb8fd400cc12abfe14aca47460ff70e
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/Vend/Dispatch.pm
View
@@ -1486,7 +1486,9 @@ EOF
if ($_ eq 'mv_pc') {
#::logDebug('$CGI::values{mv_pc} is %s', $CGI::values{mv_pc});
if ($CGI::values{mv_pc} and $CGI::values{mv_pc} =~ /\D/) {
- $new_source = $Vend::Session->{source} = $CGI::values{mv_pc};
+ $new_source = $CGI::values{mv_pc};
+ $new_source =~ s/[\r\n\t]//g;
+ $Vend::Session->{source} = $new_source;
last SOURCEPRIORITY;
}
}
@@ -1495,6 +1497,7 @@ EOF
my $cookie_source = Vend::Util::read_cookie($1);
#::logDebug("Cookie $1 is $cookie_source");
if (length $cookie_source) {
+ $cookie_source =~ s/[\r\n\t]//g;
$Vend::Session->{source} = $cookie_source;
last SOURCEPRIORITY;
}
@@ -1517,7 +1520,9 @@ EOF
else {
#::logDebug('$CGI::values{%s} is %s', $_, $CGI::values{$_});
if (length $CGI::values{$_}) {
- $new_source = $Vend::Session->{source} = $CGI::values{$_};
+ $new_source = $CGI::values{$_};
+ $new_source =~ s/[\r\n\t]//g;
+ $Vend::Session->{source} = $new_source;
last SOURCEPRIORITY;
}
}

0 comments on commit 50f9e7c

Please sign in to comment.