You are here

public static function SafeMarkup::isSafe in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Component/Utility/SafeMarkup.php \Drupal\Component\Utility\SafeMarkup::isSafe()

Checks if a string is safe to output.

Parameters

string|\Drupal\Component\Render\MarkupInterface $string: The content to be checked.

string $strategy: (optional) This value is ignored.

Return value

bool TRUE if the string has been marked secure, FALSE otherwise.

Deprecated

in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Instead, you should just check if a variable is an instance of \Drupal\Component\Render\MarkupInterface.

File

lib/Drupal/Component/Utility/SafeMarkup.php, line 43
Contains \Drupal\Component\Utility\SafeMarkup.

Class

SafeMarkup
Contains deprecated functionality related to sanitization of markup.

Namespace

Drupal\Component\Utility

Code

public static function isSafe($string, $strategy = 'html') {
  return $string instanceof MarkupInterface;
}