function fp_validate_utf8

7.x misc.inc fp_validate_utf8($text)
6.x misc.inc fp_validate_utf8($text)
4.x misc.inc fp_validate_utf8($text)
5.x misc.inc fp_validate_utf8($text)
1 call to fp_validate_utf8()
filter_xss in includes/misc.inc
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:

File

includes/misc.inc, line 1370
This file contains misc functions for FlightPath

Code

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);
}