You are here

function my_xml_escape in Recipe 7.2

Same name and namespace in other branches
  1. 6 plugins/recipe_recipeML.module \my_xml_escape()
  2. 7 includes/recipe_recipeML.module \my_xml_escape()
1 call to my_xml_escape()
recipe_recipeML_export_single in modules/recipe_recipeML.module

File

modules/recipe_recipeML.module, line 192
Enables importing and exporting of recipeML format recipes.

Code

function my_xml_escape($string, $remove_html = FALSE) {
  if ($remove_html) {
    $string = filter_xss($string, array());
  }
  $chars = array(
    '&' => '&',
    '<' => '&lt;',
    '>' => '&gt;',
    '"' => '&quot;',
    '\'' => '&apos;',
  );
  return str_replace(array_keys($chars), array_values($chars), $string);
}