[interchange: 1/2] * Fix bug where search strings that were defined with mv_search_map

Mike Heins interchange-cvs at icdevgroup.org
Tue Jul 26 17:12:44 UTC 2016


commit 3bdebfc4b77a3c8f45804ee2d4240ee16a668f22
Author: Mike Heins <mikeh at endpoint.com>
Date:   Tue Jul 26 13:09:55 2016 -0400

    * Fix bug where search strings that were defined with mv_search_map
      would not be used to create unique more cache key.

 lib/Vend/Scan.pm |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/lib/Vend/Scan.pm b/lib/Vend/Scan.pm
index 7cfc372..2c00d43 100644
--- a/lib/Vend/Scan.pm
+++ b/lib/Vend/Scan.pm
@@ -259,6 +259,20 @@ sub create_last_search {
 	my @val;
 	my ($key, $val);
 	while( ($key, $val) = each %$ref) {
+		if($key eq 'mv_search_map') {
+			my @keys = grep /\w/, split /[\s,\0]+/, $ref->{$key};
+			for(@keys) {
+				s/.*=//;
+				s/\s+$//;
+			}
+			for my $k (@keys) {
+				my $val = $ref->{$k};
+				$val =~ s!/!__SLASH__!g;
+				$val =~ s!(\W)!sprintf '%%%02x', ord($1)!eg;
+				$val =~ s!__SLASH__!::!g;
+				push @out, "$k=$val";
+			} 
+		}
 		next unless defined $RevScan{$key};
 		@val = split /\0/, $val;
 		for(@val) {
@@ -269,6 +283,7 @@ sub create_last_search {
 		}
 	}
 
+
 	# Make repeatable for permanent store
 	@out = sort @out;
 



More information about the interchange-cvs mailing list