[Slim-Checkins] r33811 - /7.7/trunk/server/Slim/Web/XMLBrowser.pm

[email protected] Sun, 05 Feb 2012 14:45:00 -0000
Newsgroups gmane.music.equipment.slimdevices.cvs
Message-ID <[email protected]>
Author: adrian
Date: Sun Feb  5 06:45:00 2012
New Revision: 33811

URL: http://svn.slimdevices.com/slim?rev=33811&view=rev
Log:
Bug: 17373
Description: fix bug in an alternative way which does not corrupt the search string

Modified:
    7.7/trunk/server/Slim/Web/XMLBrowser.pm

Modified: 7.7/trunk/server/Slim/Web/XMLBrowser.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Web/XMLBrowser.pm?rev=33811&r1=33810&r2=33811&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Web/XMLBrowser.pm (original)
+++ 7.7/trunk/server/Slim/Web/XMLBrowser.pm Sun Feb  5 06:45:00 2012
@@ -277,9 +277,6 @@
 			my $searchQuery;
 			
 			if ( $subFeed->{'type'} && $subFeed->{'type'} eq 'search' && defined $stash->{'q'} ) {
-				# bug 17373 - remove period from search expression, as it breaks our index (and is ignored during the search anyway)
-				$stash->{q} =~ s/\./ /g;
-
 				$crumbText .= '_' . uri_escape_utf8( $stash->{q}, "^A-Za-z0-9" );
 				$searchQuery = $stash->{'q'};
 			}
@@ -1186,8 +1183,14 @@
 		return;
 	}
 	
+	# Bug 17373: rewrite the index arg from raw uri if present as it will already be unescaped which breaks search encoding of index
+	# (this is the same issue as bug 17181)
+	my ($itemId) = ($response->request->uri =~ m%index=(.*?)&%);
+	if ($itemId) {
+		$args->{'index'} = $itemId;
+	}
+
 	my ($index, $quantity) = (($args->{'start'} || 0), ($args->{'itemsPerPage'} || $prefs->get('itemsPerPage')));
-	my $itemId = $args->{'index'};
 	if (defined $itemId) {
 		my $i = $itemId;
 		$i =~ s/^(?:[a-f0-9]{8})?\.?//;	# strip sessionid if present