Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
3761cb68
Commit
3761cb68
authored
Mar 08, 2020
by
IKEDA Soji
Browse files
Refactoring. Don't use REQUEST_URI but use SCRIPT_NAME, PATH_INFO and QUERY_STRING.
parent
f71abf8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cgi/wwsympa.fcgi.in
View file @
3761cb68
...
...
@@ -3861,7 +3861,7 @@ sub do_help {
# Strip extensions.
$in{'help_topic'} =~ s/[.].*// if $in{'help_topic'};
# Given partial top URI, redirect to base.
unless ($in{'help_topic'} or $ENV{
REQUEST_URI}
=~
/\
/\z
/
) {
unless ($in{'help_topic'} or
(
$ENV{
PATH_INFO} // '')
=~
m{
/\z
}
) {
$param->{'redirect_to'} = Sympa::get_url(
$list, 'help',
nomenu => $param->{'nomenu'},
...
...
@@ -8659,7 +8659,7 @@ sub do_arc {
);
return 1;
}
unless ($in{'arc_file'} or $ENV{
REQUEST_URI}
=~
/\
/\z
/
) {
unless ($in{'arc_file'} or
(
$ENV{
PATH_INFO} // '')
=~
m{
/\z
}
) {
$param->{'redirect_to'} = Sympa::get_url(
$list, 'arc',
nomenu => $param->{'nomenu'},
...
...
src/lib/Sympa/WWW/Tools.pm
View file @
3761cb68
...
...
@@ -202,26 +202,14 @@ sub get_my_url {
my
$robot
=
shift
;
my
%options
=
@_
;
my
$original_path_info
;
# Try getting encoded PATH_INFO and query.
my
$request_uri
=
$ENV
{
REQUEST_URI
}
||
'';
my
$script_name
=
$ENV
{
SCRIPT_NAME
}
||
'';
if
(
$request_uri
eq
$script_name
or
0
==
index
(
$request_uri
,
$script_name
.
'
?
')
or
0
==
index
(
$request_uri
,
$script_name
.
'
/
'))
{
$original_path_info
=
substr
(
$request_uri
,
length
$script_name
);
}
else
{
# Workaround: Encode PATH_INFO again and use it.
my
$path_info
=
$ENV
{
PATH_INFO
}
||
'';
my
$query_string
=
$ENV
{
QUERY_STRING
};
$original_path_info
=
Sympa::Tools::Text::
encode_uri
(
$path_info
,
omit
=>
'
/
')
.
(
$query_string
?
('
?
'
.
$query_string
)
:
'');
}
my
$path_info
=
$ENV
{
PATH_INFO
}
//
'';
my
$query_string
=
$ENV
{
QUERY_STRING
}
//
'';
return
Sympa::
get_url
(
$robot
,
undef
,
authority
=>
$options
{
authority
})
.
$original_path_info
;
return
Sympa::
get_url
(
$robot
,
undef
,
authority
=>
$options
{
authority
})
.
Sympa::Tools::Text::
encode_uri
(
$path_info
,
omit
=>
'
/
')
.
(
length
$query_string
?
'
?
'
:
'')
.
$query_string
;
}
# Determine robot.
...
...
Write
Preview
Supports
Markdown
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