Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
6c24e867
Commit
6c24e867
authored
3 years ago
by
Elmar Ludwig
Committed by
Jan-Hendrik Willms
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix handling of url and entity encoding for ExternModule, avoid usage of multibyte API, fixes #460
parent
f2998d95
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/extern/lib/ExternElement.class.php
+3
-3
3 additions, 3 deletions
lib/extern/lib/ExternElement.class.php
lib/extern/lib/ExternModule.class.php
+8
-22
8 additions, 22 deletions
lib/extern/lib/ExternModule.class.php
with
11 additions
and
25 deletions
lib/extern/lib/ExternElement.class.php
+
3
−
3
View file @
6c24e867
...
...
@@ -472,7 +472,7 @@ class ExternElement {
if
(
$this
->
config
->
getValue
(
$args
[
'main_module'
],
'incdata'
))
{
$link
=
$sri_link
;
if
(
$args
[
'link_args'
])
{
if
(
mb_
str
r
pos
(
$link
,
'?'
))
{
if
(
strpos
(
$link
,
'?'
))
{
$link
.
=
'&'
.
$args
[
'link_args'
];
}
else
{
$link
.
=
'?'
.
$args
[
'link_args'
];
...
...
@@ -494,7 +494,7 @@ class ExternElement {
}
$link
.
=
'page_url='
.
$sri_link
;
}
elseif
(
$extern_link
)
{
if
(
mb_
str
r
pos
(
$extern_link
,
'?'
))
{
if
(
strpos
(
$extern_link
,
'?'
))
{
$link
=
"
$extern_link
&module=
$module_name
"
;
}
else
{
$link
=
"
$extern_link
?module=
$module_name
"
;
...
...
@@ -525,4 +525,4 @@ class ExternElement {
}
return
ExternModule
::
ExtHtmlReady
(
$link
);
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
lib/extern/lib/ExternModule.class.php
+
8
−
22
View file @
6c24e867
...
...
@@ -460,9 +460,9 @@ class ExternModule {
}
$query_parts
=
[];
if
(
is_array
(
$params
))
{
$param_key
=
'ext_'
.
mb_
strtolower
(
$this
->
name
);
$param_key
=
'ext_'
.
strtolower
(
$this
->
name
);
foreach
(
$params
as
$name
=>
$value
)
{
$query_parts
[]
=
"
{
$param_key
}
[
{
$name
}
]="
.
$value
;
$query_parts
[]
=
"
{
$param_key
}
[
{
$name
}
]="
.
urlencode
(
$value
)
;
}
}
...
...
@@ -501,7 +501,6 @@ class ExternModule {
}
if
(
is_array
(
$config_meta_data
))
{
$module
=
$config_meta_data
[
'module_name'
];
// var_dump($this->config);
}
else
{
return
''
;
}
...
...
@@ -511,7 +510,7 @@ class ExternModule {
if
(
is_array
(
$query_parts
)
&&
count
(
$query_parts
))
{
$url
.
=
'&'
.
implode
(
'&'
,
$query_parts
);
}
return
$url
;
return
self
::
ExtHtmlReady
(
$url
)
;
}
function
getLinkToSelf
(
$params
=
null
,
$with_module_params
=
false
,
$linked_element_name
=
null
)
{
...
...
@@ -519,28 +518,15 @@ class ExternModule {
}
function
getModuleParams
(
$params
=
null
)
{
$param_key
=
'ext_'
.
mb_
strtolower
(
$this
->
name
);
$param_key
=
'ext_'
.
strtolower
(
$this
->
name
);
if
(
is_array
(
$_REQUEST
[
$param_key
]))
{
$ret
=
[];
if
(
is_null
(
$params
))
{
if
(
is_array
(
$_GET
[
$param_key
]))
{
foreach
(
$_GET
[
$param_key
]
as
$key
=>
$value
)
{
$ret
[
$key
]
=
urldecode
(
$value
);
}
}
if
(
is_array
(
$_POST
[
$param_key
]))
{
foreach
(
$_POST
[
$param_key
]
as
$key
=>
$value
)
{
$ret
[
$key
]
=
$value
;
}
}
return
$ret
;
return
$_REQUEST
[
$param_key
];
}
foreach
(
$params
as
$param
)
{
if
(
isset
(
$_GET
[
$param_key
][
$param
]))
{
$ret
[
$param
]
=
urldecode
(
$_GET
[
$param_key
][
$param
]);
}
if
(
isset
(
$_POST
[
$param_key
][
$param
]))
{
$ret
[
$param
]
=
$_POST
[
$param_key
][
$param
];
if
(
isset
(
$_REQUEST
[
$param_key
][
$param
]))
{
$ret
[
$param
]
=
$_REQUEST
[
$param_key
][
$param
];
}
}
return
$ret
;
...
...
@@ -585,4 +571,4 @@ class ExternModule {
}
return
false
;
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment