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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
038dee46
Commit
038dee46
authored
Apr 30, 2015
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2458387
by stefan.r, anksy, andypost, alexpott, hussainweb: Remove Utility\String class
parent
736289f2
No related branches found
No related tags found
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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Component/Utility/String.php
+0
-104
0 additions, 104 deletions
core/lib/Drupal/Component/Utility/String.php
with
0 additions
and
104 deletions
core/lib/Drupal/Component/Utility/String.php
deleted
100644 → 0
+
0
−
104
View file @
736289f2
<?php
/**
* @file
* Contains \Drupal\Component\Utility\SafeMarkup.
*/
namespace
Drupal\Component\Utility
;
/**
* Provides helpers to operate on strings.
*
* @ingroup utility
*/
class
String
{
/**
* Encodes special characters in a plain-text string for display as HTML.
*
* @param string $text
* The text to be checked or processed.
*
* @return string
* An HTML safe version of $text, or an empty string if $text is not
* valid UTF-8.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal\Component\Utility\SafeMarkup::checkPlain() instead.
*/
public
static
function
checkPlain
(
$text
)
{
return
SafeMarkup
::
checkPlain
(
$text
);
}
/**
* Decodes all HTML entities including numerical ones to regular UTF-8 bytes.
*
* @param string $text
* The text to decode entities in.
*
* @return string
* The input $text, with all HTML entities decoded once.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal\Component\Utility\Html::decodeEntities() instead.
*/
public
static
function
decodeEntities
(
$text
)
{
return
Html
::
decodeEntities
(
$text
);
}
/**
* Formats a string for HTML display by replacing variable placeholders.
*
* @param $string
* A string containing placeholders. The string itself is not escaped, any
* unsafe content must be in $args and inserted via 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:
* - @variable: Escaped to HTML using
* \Drupal\Component\Utility\SafeMarkup::escape(). Use this as the
* default choice for anything displayed on a page on the site.
* - %variable: Escaped to HTML and formatted using SafeMarkup::placeholder(),
* which makes the following HTML code:
* @code
* <em class="placeholder">text output here.</em>
* @endcode
* - !variable: Inserted as is, with no sanitization or formatting. Only
* use this when the resulting string is being generated for one of:
* - Non-HTML usage, such as a plain-text email.
* - Non-direct HTML output, such as a plain-text variable that will be
* printed as an HTML attribute value and therefore formatted with
* SafeMarkup::checkPlain() as part of that.
* - Some other special reason for suppressing sanitization.
*
* @return string
* The formatted string, which is marked as safe unless sanitization of an
* unsafe argument was suppressed (see above).
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal\Component\Utility\SafeMarkup::format() instead.
*/
public
static
function
format
(
$string
,
array
$args
=
array
())
{
return
SafeMarkup
::
format
(
$string
,
$args
);
}
/**
* Formats text for emphasized display in a placeholder inside a sentence.
*
* @param string $text
* The text to format (plain-text).
*
* @return string
* The formatted text (html).
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal\Component\Utility\SafeMarkup::placeholder() instead.
*/
public
static
function
placeholder
(
$text
)
{
return
SafeMarkup
::
placeholder
(
$text
);
}
}
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