public static SafeMarkup::isSafe($string, $strategy = 'html')
Checks if a string is safe to output.
string|\Drupal\Component\Render\MarkupInterface $string: The content to be checked.
string $strategy: (optional) This value is ignored.
bool TRUE if the string has been marked secure, FALSE otherwise.
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.
public static function isSafe($string, $strategy = 'html') { return $string instanceof MarkupInterface; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!SafeMarkup.php/function/SafeMarkup::isSafe/8.1.x