SafeMarkup::isSafe

public static SafeMarkup::isSafe($string, $strategy = 'html')

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

core/lib/Drupal/Component/Utility/SafeMarkup.php, line 38

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;
}
doc_Drupal
2016-10-29 09:39:32
Comments
Leave a Comment

Please login to continue.