Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
a2d546e3
Commit
a2d546e3
authored
18 years ago
by
Neil Drumm
Browse files
Options
Downloads
Patches
Plain Diff
#82524
by Heine and AjK. Remove use of array_walk(), which was causing segfaults in this case.
parent
160b2e55
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
includes/common.inc
+15
-21
15 additions, 21 deletions
includes/common.inc
includes/install.inc
+15
-21
15 additions, 21 deletions
includes/install.inc
with
30 additions
and
42 deletions
includes/common.inc
+
15
−
21
View file @
a2d546e3
...
@@ -633,31 +633,25 @@ function t($string, $args = 0) {
...
@@ -633,31 +633,25 @@ function t($string, $args = 0) {
}
}
else
{
else
{
// Transform arguments before inserting them
// Transform arguments before inserting them
array_walk
(
$args
,
'_t'
);
foreach
(
$args
as
$key
=>
$value
)
{
switch
(
$key
[
0
])
{
// Escaped only
case
'@'
:
$args
[
$key
]
=
check_plain
(
$value
);
break
;
// Escaped and placeholder
case
'%'
:
default
:
$args
[
$key
]
=
theme
(
'placeholder'
,
$value
);
break
;
// Pass-through
case
'!'
:
}
}
return
strtr
(
$string
,
$args
);
return
strtr
(
$string
,
$args
);
}
}
}
}
/**
* Helper function: apply the appropriate transformation to st() and t()
* placeholders.
*/
function
_t
(
&
$value
,
$key
)
{
switch
(
$key
[
0
])
{
// Escaped only
case
'@'
:
$value
=
check_plain
(
$value
);
return
;
// Escaped and placeholder
case
'%'
:
default
:
$value
=
theme
(
'placeholder'
,
$value
);
return
;
// Pass-through
case
'!'
:
}
}
/**
/**
* @defgroup validation Input validation
* @defgroup validation Input validation
* @{
* @{
...
...
This diff is collapsed.
Click to expand it.
includes/install.inc
+
15
−
21
View file @
a2d546e3
...
@@ -579,30 +579,24 @@ function st($string, $args = array()) {
...
@@ -579,30 +579,24 @@ function st($string, $args = array()) {
require_once
'./includes/theme.inc'
;
require_once
'./includes/theme.inc'
;
$GLOBALS
[
'theme'
]
=
'theme'
;
$GLOBALS
[
'theme'
]
=
'theme'
;
// Transform arguments before inserting them
// Transform arguments before inserting them
array_walk
(
$args
,
'_st'
);
foreach
(
$args
as
$key
=>
$value
)
{
return
strtr
((
!
empty
(
$locale_strings
[
$string
])
?
$locale_strings
[
$string
]
:
$string
),
$args
);
switch
(
$key
[
0
])
{
}
// Escaped only
case
'@'
:
/**
$args
[
$key
]
=
check_plain
(
$value
);
* Helper function: apply the appropriate transformation to st() and t() placeholders.
break
;
*/
// Escaped and placeholder
function
_st
(
&
$value
,
$key
)
{
case
'%'
:
switch
(
$key
[
0
])
{
default
:
// Escaped only
$args
[
$key
]
=
'<em>'
.
check_plain
(
$value
)
.
'</em>'
;
case
'@'
:
break
;
$value
=
check_plain
(
$value
);
// Pass-through
return
;
case
'!'
:
// Escaped and placeholder
}
case
'%'
:
default
:
$value
=
'<em>'
.
check_plain
(
$value
)
.
'</em>'
;
return
;
// Pass-through
case
'!'
:
}
}
return
strtr
((
!
empty
(
$locale_strings
[
$string
])
?
$locale_strings
[
$string
]
:
$string
),
$args
);
}
}
/**
/**
* Check a profile's requirements.
* Check a profile's requirements.
*
*
...
...
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