function _views_oai_pmh_xmlstr in Views OAI-PMH 7.2
Same name and namespace in other branches
- 6 theme/views_oai_pmh.theme.inc \_views_oai_pmh_xmlstr()
- 7 theme/views_oai_pmh.theme.inc \_views_oai_pmh_xmlstr()
File
- theme/
views_oai_pmh.theme.inc, line 289 - Theme related functions for processing our output style plugins.
Code
function _views_oai_pmh_xmlstr($string, $charset = 'iso8859-1', $xmlescaped = 'false') {
$xmlstr = stripslashes(trim($string));
// just remove invalid characters
$pattern = "/[\\x-\10\v-\f\16-\37]/";
$xmlstr = preg_replace($pattern, '', $xmlstr);
// escape only if string is not escaped
if (!$xmlescaped) {
$xmlstr = htmlspecialchars($xmlstr, ENT_QUOTES);
}
return $xmlstr;
}