From 31ef440741dc2f76bd4fffac902770b10e716350 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Thu, 10 Jul 2008 08:31:16 -0500 Subject: [PATCH] Bugfix pagination_bar to work with only one param/value pair. A valid test of this patch is this command: perl -MC4::Output -e 'print pagination_bar("my/script?query=foobar",5,2,"page"),"\n";' The output before patch begins:  << and AFTER patch:  << The double "?" in QUERY_STRING are now avoided. Signed-off-by: Joshua Ferraro --- C4/Output.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Output.pm b/C4/Output.pm index ea889e46f9..fd32541a02 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -240,7 +240,7 @@ sub pagination_bar { $base_url =~ s/$delim;//g; # remove empties $base_url =~ s/$delim$//; # remove trailing delim - my $url = $base_url . ( $base_url =~ m/$delim/ ? '&' : '?' ) . $startfrom_name . '='; + my $url = $base_url . (($base_url =~ m/$delim/ or $base_url =~ m/\?/) ? '&' : '?' ) . $startfrom_name . '='; my $pagination_bar = ''; # navigation bar useful only if more than one page to display ! -- 2.39.5