function views_rdf_strip_illegal_chars in Views Datasource 5
Same name and namespace in other branches
- 6 views_rdf.module \views_rdf_strip_illegal_chars()
- 7 views_rdf.module \views_rdf_strip_illegal_chars()
Strips illegal Unicode characters and encodes entities in string
Parameters
string $input:
Return value
string
2 calls to views_rdf_strip_illegal_chars()
File
- ./
views_rdf.module, line 472 - Provides Views plugin for rendering node content as RDF.
Code
function views_rdf_strip_illegal_chars($input) {
$output = preg_replace('/[\\x{80}-\\x{A0}' . '\\x{01}-\\x{1F}' . '\\x{AD}' . '\\x{2000}-\\x{200F}' . '\\x{2028}-\\x{202F}' . '\\x{205F}-\\x{206F}' . '\\x{FEFF}' . '\\x{FF01}-\\x{FF60}' . '\\x{FFF9}-\\x{FFFD}' . '\\x{0}]/u', '', $input);
// $output = str_replace('"', '"', $output); //encode quote
// $output = str_replace('&', '&', $output); //encode ampersand
// $output = str_replace("'", '&pos;', $output); //encode apostrophe
// $output = str_replace('<', '<', $output); //encode left-angled bracket
// $output = str_replace('>', '&rt;', $output); //encode right-angled bracket
return check_plain(strip_tags($output));
}