Bug 5305: CCL query, then resort, loses reults.
authorruth@bywatersolutions.com <ruth@bywatersolutions.com>
Wed, 30 Mar 2011 16:11:51 +0000 (11:11 -0500)
committerChris Nighswonger <chris.nighswonger@gmail.com>
Mon, 11 Apr 2011 19:12:52 +0000 (15:12 -0400)
If you did a CCL query, then attempted resort, you would get the advanced-search page,
because of wonky URL escaping of the q= clause.  This patch fixes that.

Signed-off-by: Liz Rea <lrea@nekls.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 8548b804f49a5e84a64b7caf2457daf1a83f834b)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
catalogue/search.pl

index 426bf2e..a073b16 100755 (executable)
@@ -452,10 +452,9 @@ my $scan_index_to_use;
 
 for my $this_cgi ( split('&',$query_cgi) ) {
     next unless $this_cgi;
-    $this_cgi =~ m/(.*=)(.*)/;
+    $this_cgi =~ m/(.?)=(.*)/;
     my $input_name = $1;
     my $input_value = $2;
-    $input_name =~ s/=$//;
     push @query_inputs, { input_name => $input_name, input_value => $input_value };
        if ($input_name eq 'idx') {
        $scan_index_to_use = $input_value; # unless $scan_index_to_use;