Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
50ee6eb2
Commit
50ee6eb2
authored
Feb 27, 2012
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 730670: Do not redirect in buglist.cgi to improve performance
r=glob a=LpSolit
parent
c650592f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
5 deletions
+55
-5
CGI.pm
Bugzilla/CGI.pm
+9
-1
buglist.cgi
buglist.cgi
+3
-2
common-links.html.tmpl
template/en/default/global/common-links.html.tmpl
+7
-0
list.html.tmpl
template/en/default/list/list.html.tmpl
+24
-2
form.html.tmpl
template/en/default/search/form.html.tmpl
+5
-0
search-specific.html.tmpl
template/en/default/search/search-specific.html.tmpl
+7
-0
No files found.
Bugzilla/CGI.pm
View file @
50ee6eb2
...
@@ -189,7 +189,10 @@ sub clean_search_url {
...
@@ -189,7 +189,10 @@ sub clean_search_url {
# list_id is added in buglist.cgi after calling clean_search_url,
# list_id is added in buglist.cgi after calling clean_search_url,
# and doesn't need to be saved in saved searches.
# and doesn't need to be saved in saved searches.
$self
->
delete
(
'list_id'
);
$self
->
delete
(
'list_id'
);
# no_redirect is used internally by redirect_search_url().
$self
->
delete
(
'no_redirect'
);
# And now finally, if query_format is our only parameter, that
# And now finally, if query_format is our only parameter, that
# really means we have no parameters, so we should delete query_format.
# really means we have no parameters, so we should delete query_format.
...
@@ -445,6 +448,7 @@ sub redirect_search_url {
...
@@ -445,6 +448,7 @@ sub redirect_search_url {
return
;
return
;
}
}
my
$no_redirect
=
$self
->
param
(
'no_redirect'
);
$self
->
clean_search_url
();
$self
->
clean_search_url
();
# Make sure we still have params still after cleaning otherwise we
# Make sure we still have params still after cleaning otherwise we
...
@@ -458,6 +462,10 @@ sub redirect_search_url {
...
@@ -458,6 +462,10 @@ sub redirect_search_url {
$self
->
param
(
'list_id'
,
$recent_search
->
id
);
$self
->
param
(
'list_id'
,
$recent_search
->
id
);
}
}
# Browsers which support history.replaceState do not need to be
# redirected. We can fix the URL on the fly.
return
if
$no_redirect
;
# GET requests that lacked a list_id are always redirected. POST requests
# GET requests that lacked a list_id are always redirected. POST requests
# are only redirected if they're under the CGI_URI_LIMIT though.
# are only redirected if they're under the CGI_URI_LIMIT though.
my
$uri_length
=
length
(
$self
->
self_url
());
my
$uri_length
=
length
(
$self
->
self_url
());
...
...
buglist.cgi
View file @
50ee6eb2
...
@@ -37,19 +37,20 @@ my $cgi = Bugzilla->cgi;
...
@@ -37,19 +37,20 @@ my $cgi = Bugzilla->cgi;
my
$dbh
=
Bugzilla
->
dbh
;
my
$dbh
=
Bugzilla
->
dbh
;
my
$template
=
Bugzilla
->
template
;
my
$template
=
Bugzilla
->
template
;
my
$vars
=
{};
my
$vars
=
{};
my
$buffer
=
$cgi
->
query_string
();
# We have to check the login here to get the correct footer if an error is
# We have to check the login here to get the correct footer if an error is
# thrown and to prevent a logged out user to use QuickSearch if 'requirelogin'
# thrown and to prevent a logged out user to use QuickSearch if 'requirelogin'
# is turned 'on'.
# is turned 'on'.
my
$user
=
Bugzilla
->
login
();
my
$user
=
Bugzilla
->
login
();
$cgi
->
redirect_search_url
();
my
$buffer
=
$cgi
->
query_string
();
if
(
length
(
$buffer
)
==
0
)
{
if
(
length
(
$buffer
)
==
0
)
{
print
$cgi
->
header
(
-
refresh
=>
'10; URL=query.cgi'
);
print
$cgi
->
header
(
-
refresh
=>
'10; URL=query.cgi'
);
ThrowUserError
(
"buglist_parameters_required"
);
ThrowUserError
(
"buglist_parameters_required"
);
}
}
$cgi
->
redirect_search_url
();
# Determine whether this is a quicksearch query.
# Determine whether this is a quicksearch query.
my
$searchstring
=
$cgi
->
param
(
'quicksearch'
);
my
$searchstring
=
$cgi
->
param
(
'quicksearch'
);
...
...
template/en/default/global/common-links.html.tmpl
View file @
50ee6eb2
...
@@ -21,6 +21,13 @@
...
@@ -21,6 +21,13 @@
onsubmit="if (this.quicksearch.value == '')
onsubmit="if (this.quicksearch.value == '')
{ alert('Please enter one or more search terms first.');
{ alert('Please enter one or more search terms first.');
return false; } return true;">
return false; } return true;">
<input type="hidden" id="no_redirect" name="no_redirect" value="0">
<script type="text/javascript">
if (history && history.replaceState) {
var no_redirect = document.getElementById("no_redirect");
no_redirect.value = 1;
}
</script>
<input class="txt" type="text" id="quicksearch[% qs_suffix FILTER html %]" name="quicksearch"
<input class="txt" type="text" id="quicksearch[% qs_suffix FILTER html %]" name="quicksearch"
title="Quick Search" value="[% quicksearch FILTER html %]">
title="Quick Search" value="[% quicksearch FILTER html %]">
<input class="btn" type="submit" value="Search"
<input class="btn" type="submit" value="Search"
...
...
template/en/default/list/list.html.tmpl
View file @
50ee6eb2
...
@@ -18,13 +18,35 @@
...
@@ -18,13 +18,35 @@
[% PROCESS "global/field-descs.none.tmpl" %]
[% PROCESS "global/field-descs.none.tmpl" %]
[% title = "$terms.Bug List" %]
[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]
[% unfiltered_title = "$terms.Bug List" %]
[% IF searchname || defaultsavename %]
[% IF searchname || defaultsavename %]
[%
title = title _ ": " _ (searchname OR defaultsavename) FILTER html
%]
[%
unfiltered_title = unfiltered_title _ ": " _ (searchname OR defaultsavename)
%]
[% END %]
[% END %]
[% title = unfiltered_title FILTER html %]
[% qorder = order FILTER uri IF order %]
[% qorder = order FILTER uri IF order %]
[% javascript = BLOCK %]
[% new_url = cgi.self_url %]
[% IF quicksearch %]
[% new_url = BLOCK ~%]
buglist.cgi?quicksearch=[% quicksearch FILTER uri %]
[%~ IF cgi.param('list_id') ~%]
&list_id=[% cgi.param('list_id') FILTER uri %]
[%~ END %]
[% END %]
[% END %]
if (history && history.replaceState) {
history.replaceState(null, "[% unfiltered_title FILTER js %]",
"[% new_url FILTER js %]");
document.title = "[% unfiltered_title FILTER js %]";
}
[% javascript FILTER none %]
[% END %]
[%############################################################################%]
[%############################################################################%]
[%# Page Header #%]
[%# Page Header #%]
...
...
template/en/default/search/form.html.tmpl
View file @
50ee6eb2
...
@@ -8,7 +8,12 @@
...
@@ -8,7 +8,12 @@
[% PROCESS "global/field-descs.none.tmpl" %]
[% PROCESS "global/field-descs.none.tmpl" %]
<input type="hidden" id="no_redirect" name="no_redirect" value="0">
<script type="text/javascript">
<script type="text/javascript">
if (history && history.replaceState) {
var no_redirect = document.getElementById("no_redirect");
no_redirect.value = 1;
}
// Hide the Advanced Fields by default, unless the user has a cookie
// Hide the Advanced Fields by default, unless the user has a cookie
// that specifies otherwise.
// that specifies otherwise.
...
...
template/en/default/search/search-specific.html.tmpl
View file @
50ee6eb2
...
@@ -28,6 +28,13 @@ for "crash secure SSL flash".
...
@@ -28,6 +28,13 @@ for "crash secure SSL flash".
<form name="queryform" method="get" action="buglist.cgi">
<form name="queryform" method="get" action="buglist.cgi">
<input type="hidden" name="query_format" value="specific">
<input type="hidden" name="query_format" value="specific">
<input type="hidden" name="order" value="relevance desc">
<input type="hidden" name="order" value="relevance desc">
<input type="hidden" id="no_redirect" name="no_redirect" value="0">
<script type="text/javascript">
if (history && history.replaceState) {
var no_redirect = document.getElementById("no_redirect");
no_redirect.value = 1;
}
</script>
<table summary="Search fields" class="bz_simple_search_form">
<table summary="Search fields" class="bz_simple_search_form">
<tr>
<tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment