function fp_validate_utf8

6.x fp_validate_utf8($text)
7.x fp_validate_utf8($text)
4.x fp_validate_utf8($text)
5.x fp_validate_utf8($text)
1 call to fp_validate_utf8()
filter_xss in includes/
This function is taken almost directly from Drupal 7's core code. It is used to help us filter out dangerous HTML which the user might type. From the D7 documentation:


includes/, line 1319
This file contains misc functions for FlightPath


function fp_validate_utf8($text) {
  if (strlen($text) == 0) {
    return TRUE;
  // With the PCRE_UTF8 modifier 'u', preg_match() fails silently on strings
  // containing invalid UTF-8 byte sequences. It does not reject character
  // codes above U+10FFFF (represented by 4 or more octets), though.
  return (preg_match('/^./us', $text) == 1);