]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 15089: Make buglist.cgi shorten search URLs by cleaning them and then redirecting...
authormkanat%bugzilla.org <>
Fri, 12 Sep 2008 03:09:19 +0000 (03:09 +0000)
committermkanat%bugzilla.org <>
Fri, 12 Sep 2008 03:09:19 +0000 (03:09 +0000)
Patch By Mikhail Gusarov <dottedmag@altlinux.org> r=mkanat, a=mkanat

buglist.cgi
template/en/default/search/search-advanced.html.tmpl

index 6619fdd6588e7f3f41ef8c096ad3399f780d1b7d..687146ed64f831a08153638bcaccb00a29ac3251 100755 (executable)
@@ -66,6 +66,17 @@ if (length($buffer) == 0) {
     ThrowUserError("buglist_parameters_required");
 }
 
+#
+# If query was POSTed, clean the URL from empty parameters and redirect back to
+# itself. This will make advanced search URLs more tolerable.
+#
+if ($cgi->request_method() eq 'POST') {
+    $cgi->clean_search_url();
+
+    print $cgi->redirect(-url => $cgi->self_url());
+    exit;
+}
+
 # Determine whether this is a quicksearch query.
 my $searchstring = $cgi->param('quicksearch');
 if (defined($searchstring)) {
index 1f1fd50ab8aeccdad8eab62b1cba79c65869bfd3..cb0519a817b599ef5786fdcf95be7b4310136fc1 100644 (file)
@@ -64,7 +64,7 @@ var queryform = "queryform"
 // -->
 </script>
 
-<form method="get" action="buglist.cgi" name="queryform">
+<form method="post" action="buglist.cgi" name="queryform">
 
 [% PROCESS search/form.html.tmpl %]