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
7d985d59
Commit
7d985d59
authored
11 years ago
by
Jennifer Hodgdon
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2195749
by longwave: Fix up docs in String class
parent
74bb4e2c
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Component/Utility/String.php
+11
-11
11 additions, 11 deletions
core/lib/Drupal/Component/Utility/String.php
with
11 additions
and
11 deletions
core/lib/Drupal/Component/Utility/String.php
+
11
−
11
View file @
7d985d59
...
...
@@ -24,9 +24,9 @@ class String {
* An HTML safe version of $text, or an empty string if $text is not
* valid UTF-8.
*
* @see drupal_validate_utf8()
*
* @ingroup sanitization
*
* @see drupal_validate_utf8()
*/
public
static
function
checkPlain
(
$text
)
{
return
htmlspecialchars
(
$text
,
ENT_QUOTES
,
'UTF-8'
);
...
...
@@ -54,9 +54,9 @@ public static function decodeEntities($text) {
*
* This function replaces variable placeholders in a string with the requested
* values and escapes the values so they can be safely displayed as HTML. It
* should be used on any unknown text that is intended to be printed to an
HTML
* page (especially text that may have come from untrusted users, since
in that
* case it prevents cross-site scripting and other security problems).
* should be used on any unknown text that is intended to be printed to an
*
HTML
page (especially text that may have come from untrusted users, since
*
in that
case it prevents cross-site scripting and other security problems).
*
* In most cases, you should use t() rather than calling this function
* directly, since it will translate the text (on non-English-only sites) in
...
...
@@ -66,9 +66,9 @@ public static function decodeEntities($text) {
* A string containing placeholders.
* @param $args
* An associative array of replacements to make. Occurrences in $string of
* any key in $args are replaced with the corresponding value, after
optional
* sanitization and formatting. The type of sanitization and
formatting
* depends on the first character of the key:
* any key in $args are replaced with the corresponding value, after
*
optional
sanitization and formatting. The type of sanitization and
*
formatting
depends on the first character of the key:
* - @variable: Escaped to HTML using String::checkPlain(). Use this as the
* default choice for anything displayed on a page on the site.
* - %variable: Escaped to HTML and formatted using String::placeholder(),
...
...
@@ -79,12 +79,12 @@ public static function decodeEntities($text) {
* String::checkPlain() previously, or is expected to contain some limited
* HTML tags and has already been run through filter_xss() previously).
*
* @return mixed
* The formatted string, or FALSE if no args specified.
*
* @see t()
* @ingroup sanitization
*
* @return mixte
* The formatted string with placeholders inserted, or FALSE if no args specified.
* @see t()
*/
public
static
function
format
(
$string
,
array
$args
=
array
())
{
// Transform arguments before inserting them.
...
...
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