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
cd04aafb
Commit
cd04aafb
authored
4 months ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
fix default for Request::i18n() if only one language is configured, fixes #4811
Closes #4811 Merge request
studip/studip!3604
parent
8ac7666c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/classes/Request.php
+6
-6
6 additions, 6 deletions
lib/classes/Request.php
with
6 additions
and
6 deletions
lib/classes/Request.php
+
6
−
6
View file @
cd04aafb
...
@@ -191,18 +191,18 @@ class Request implements ArrayAccess, IteratorAggregate
...
@@ -191,18 +191,18 @@ class Request implements ArrayAccess, IteratorAggregate
/**
/**
* Return the value of the selected query parameter as an I18NString.
* Return the value of the selected query parameter as an I18NString.
*
*
* @param string $param parameter name
* @param string
$param parameter name
* @param I18NString|null $default default value if parameter is not set
* @param I18NString|
string|
null $default default value if parameter is not set
* @param callable|null $op Operation to perform on each text string
* @param callable|null
$op Operation to perform on each text string
*
*
* @return I18NString parameter value as string (if set), else NULL
* @return I18NString parameter value as string (if set), else NULL
*/
*/
public
static
function
i18n
(
string
$param
,
?I18NString
$default
=
NULL
,
Callable
$op
=
null
)
public
static
function
i18n
(
string
$param
,
$default
=
null
,
Callable
$op
=
null
)
{
{
$value
=
self
::
get
(
$param
,
$default
?
$default
->
original
()
:
n
ul
l
);
$value
=
self
::
get
(
$param
,
$default
instanceof
I18NString
?
$default
->
original
()
:
$defa
ul
t
);
if
(
isset
(
$value
))
{
if
(
isset
(
$value
))
{
$lang
=
self
::
getArray
(
$param
.
'_i18n'
)
?:
(
$default
?
$default
->
toArray
()
:
[]);
$lang
=
self
::
getArray
(
$param
.
'_i18n'
)
?:
(
$default
instanceof
I18NString
?
$default
->
toArray
()
:
[]);
if
(
$op
)
{
if
(
$op
)
{
$value
=
$op
(
$value
);
$value
=
$op
(
$value
);
...
...
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