You are here

function views_xhtml_strip_illegal_chars in Views Datasource 5

Strips illegal Unicode characters and encodes entities in string

Parameters

string $input:

Return value

string

2 calls to views_xhtml_strip_illegal_chars()
views_xhtml_hCalendar_render in ./views_xhtml.module
views_xhtml_hCard_render in ./views_xhtml.module

File

./views_xhtml.module, line 554
Provides Views plugin for rendering node content as XHTML microformats.

Code

function views_xhtml_strip_illegal_chars($input) {

  //  $output = preg_replace('/[\x{80}-\x{A0}'. // Non-printable ISO-8859-1 + NBSP
  //        '\x{01}-\x{1F}'. //Non-printable ASCII characters
  //        '\x{AD}'. // Soft-hyphen
  //        '\x{2000}-\x{200F}'. // Various space characters
  //        '\x{2028}-\x{202F}'. // Bidirectional text overrides
  //        '\x{205F}-\x{206F}'. // Various text hinting characters
  //        '\x{FEFF}'. // Byte order mark
  //        '\x{FF01}-\x{FF60}'. // Full-width latin
  //        '\x{FFF9}-\x{FFFD}'. // Replacement characters
  //        '\x{0}]/u', // NULL byte
  //        '', $input);
  //  $output = str_replace('"', '"', $output); //encode quote
  //  $output = str_replace('&', '&', $output); //encode ampersand
  //  $output = str_replace("'", '&pos;', $output); //encode apostrophe
  //  $output = str_replace('<', '&lt;', $output); //encode left-angled bracket
  //  $output = str_replace('>', '&rt;', $output); //encode right-angled bracket
  //  return $output;
  return check_plain(strip_tags($input));
}