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
ebc758fb
Commit
ebc758fb
authored
Mar 13, 2011
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 637977: Re-setup CGI.pm global variables on every request under mod_perl,
which prevents CGI.pm from generating URLs with semicolons in them instead of ampersands. r=glob, a=mkanat
parent
8782cbb1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
13 deletions
+29
-13
Bugzilla.pm
Bugzilla.pm
+5
-0
CGI.pm
Bugzilla/CGI.pm
+24
-13
No files found.
Bugzilla.pm
View file @
ebc758fb
...
...
@@ -647,6 +647,11 @@ sub _cleanup {
$dbh
->
disconnect
;
}
undef
$_request_cache
;
# These are both set by CGI.pm but need to be undone so that
# Apache can actually shut down its children if it needs to.
$SIG
{
TERM
}
=
'DEFAULT'
if
$SIG
{
TERM
}
eq
'IGNORE'
;
$SIG
{
PIPE
}
=
'DEFAULT'
if
$SIG
{
PIPE
}
eq
'IGNORE'
;
}
sub
END
{
...
...
Bugzilla/CGI.pm
View file @
ebc758fb
...
...
@@ -23,6 +23,7 @@
package
Bugzilla::
CGI
;
use
strict
;
use
base
qw(CGI)
;
use
Bugzilla::
Constants
;
use
Bugzilla::
Error
;
...
...
@@ -39,19 +40,6 @@ BEGIN {
}
}
use
CGI
qw(-no_xhtml -oldstyle_urls :private_tempfiles
:unique_headers SERVER_PUSH)
;
use
base
qw(CGI)
;
# We need to disable output buffering - see bug 179174
$|
=
1
;
# Ignore SIGTERM and SIGPIPE - this prevents DB corruption. If the user closes
# their browser window while a script is running, the web server sends these
# signals, and we don't want to die half way through a write.
$::SIG
{
TERM
}
=
'IGNORE'
;
$::SIG
{
PIPE
}
=
'IGNORE'
;
# CGI.pm uses AUTOLOAD, but explicitly defines a DESTROY sub.
# We need to do so, too, otherwise perl dies when the object is destroyed
# and we don't have a DESTROY method (because CGI.pm's AUTOLOAD will |die|
...
...
@@ -61,10 +49,33 @@ sub DESTROY {
$self
->
SUPER::
DESTROY
(
@_
);
};
sub
_init_bz_cgi_globals
{
my
$invocant
=
shift
;
# We need to disable output buffering - see bug 179174
$|
=
1
;
# Ignore SIGTERM and SIGPIPE - this prevents DB corruption. If the user closes
# their browser window while a script is running, the web server sends these
# signals, and we don't want to die half way through a write.
$SIG
{
TERM
}
=
'IGNORE'
;
$SIG
{
PIPE
}
=
'IGNORE'
;
# We don't precompile any functions here, that's done specially in
# mod_perl code.
$invocant
->
_setup_symbols
(
qw(:no_xhtml :oldstyle_urls :private_tempfiles
:unique_headers)
);
}
BEGIN
{
__PACKAGE__
->
_init_bz_cgi_globals
()
if
i_am_cgi
();
}
sub
new
{
my
(
$invocant
,
@args
)
=
@_
;
my
$class
=
ref
(
$invocant
)
||
$invocant
;
# Under mod_perl, CGI's global variables get reset on each request,
# so we need to set them up again every time.
$class
->
_init_bz_cgi_globals
()
if
$ENV
{
MOD_PERL
};
my
$self
=
$class
->
SUPER::
new
(
@args
);
# Make sure our outgoing cookie list is empty on each invocation
...
...
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