Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
294
Merge Requests
294
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
7d985d59
Commit
7d985d59
authored
Feb 27, 2014
by
jhodgdon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2195749
by longwave: Fix up docs in String class
parent
74bb4e2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
core/lib/Drupal/Component/Utility/String.php
core/lib/Drupal/Component/Utility/String.php
+11
-11
No files found.
core/lib/Drupal/Component/Utility/String.php
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.
...
...
Write
Preview
Markdown
is supported
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