diff --git a/core/lib/Drupal/Component/Render/EscapableString.php b/core/lib/Drupal/Component/Render/EscapableString.php index eb44f16..ab42583 100644 --- a/core/lib/Drupal/Component/Render/EscapableString.php +++ b/core/lib/Drupal/Component/Render/EscapableString.php @@ -13,6 +13,9 @@ /** * Escapes a string for display in markup. * + * This class can be used to provide theme engine-like late escaping + * functionality. + * * @ingroup sanitization */ class EscapableString implements EscapableStringInterface { diff --git a/core/lib/Drupal/Component/Render/MarkupInterface.php b/core/lib/Drupal/Component/Render/MarkupInterface.php index 2da4e13..65ab29a 100644 --- a/core/lib/Drupal/Component/Render/MarkupInterface.php +++ b/core/lib/Drupal/Component/Render/MarkupInterface.php @@ -31,6 +31,9 @@ * @see \Drupal\Component\Render\FormattableMarkup * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\views\Render\ViewsRenderPipelineMarkup + * @see twig_render_template() + * @see sanitization + * @see theme_render */ interface MarkupInterface extends \JsonSerializable { diff --git a/core/lib/Drupal/Component/Utility/SafeMarkup.php b/core/lib/Drupal/Component/Utility/SafeMarkup.php index a64ac28..ec12419 100644 --- a/core/lib/Drupal/Component/Utility/SafeMarkup.php +++ b/core/lib/Drupal/Component/Utility/SafeMarkup.php @@ -12,24 +12,11 @@ use Drupal\Component\Render\MarkupInterface; /** - * Manages known safe strings for rendering at the theme layer. + * Contains deprecated functionality related to sanitization of markup. * - * The Twig theme engine autoescapes string variables in the template, so it - * is possible for a string of markup to become double-escaped. SafeMarkup - * provides a store for known safe strings and methods to manage them - * throughout the page request. - * - * Strings sanitized by self::checkPlain() and self::escape() are automatically - * marked safe, as are markup strings created from @link theme_render render - * arrays @endlink via drupal_render(). - * - * This class should be limited to internal use only. Module developers should - * instead use the appropriate - * @link sanitization sanitization functions @endlink or the - * @link theme_render theme and render systems @endlink so that the output can - * can be themed, escaped, and altered properly. - * - * @deprecated Will be removed before Drupal 9.0.0. + * @deprecated Will be removed before Drupal 9.0.0. Use the appropriate + * @link sanitization sanitization functions @endlink or the @link theme_render theme and render systems @endlink + * so that the output can can be themed, escaped, and altered properly. * * @see TwigExtension::escapeFilter() * @see twig_render_template() @@ -71,8 +58,6 @@ public static function isSafe($string, $strategy = 'html') { * @return \Drupal\Component\Render\EscapableStringInterface * An EscapableString object that escapes when rendered to string. * - * @ingroup sanitization - * * @deprecated Will be removed before Drupal 9.0.0. Rely on Twig's * auto-escaping feature, or use the @link theme_render #plain_text @endlink * key when constructing a render array that contains plain text in order to @@ -101,8 +86,6 @@ public static function checkPlain($text) { * The formatted string, which is an instance of MarkupInterface unless * sanitization of an unsafe argument was suppressed (see above). * - * @ingroup sanitization - * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Component\Render\FormattableMarkup *