[interchange] Strip bad characters from affiliate source.

Peter Ajamian <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit 50f9e7c76eb8fd400cc12abfe14aca47460ff70e
Author: Peter Ajamian <[email protected]>
Date:   Sat Feb 5 19:17:46 2011 +1300

    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.

 lib/Vend/Dispatch.pm |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/lib/Vend/Dispatch.pm b/lib/Vend/Dispatch.pm
index 5e51762..9c9e557 100644
--- a/lib/Vend/Dispatch.pm
+++ b/lib/Vend/Dispatch.pm
@@ -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;
             }
          }
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.