You are here

function _views_xml_strip_illegal_xml_attribute_value_chars in Views Datasource 7

Same name and namespace in other branches
  1. 6 views_xml.module \_views_xml_strip_illegal_xml_attribute_value_chars()

Replaces illegal characters in a attribute value string with their encoded entities as well as the " char.

Parameters

$input: String to process.

Return value

String with illegal characters stripped away and entities encoded.

2 calls to _views_xml_strip_illegal_xml_attribute_value_chars()
template_preprocess_views_views_xml_style_opml in views/theme/views_views_xml_style.theme.inc
template_preprocess_views_views_xml_style_raw in views/theme/views_views_xml_style.theme.inc
@file View template to render view fields as XML.

File

./views_xml.module, line 177
Module definition for views_xml

Code

function _views_xml_strip_illegal_xml_attribute_value_chars($input) {
  $output = str_replace('<', '&lt;', $input);

  // encode left-angled bracket
  $output = str_replace('>', '&gt;', $output);

  // encode right-angled bracket
  $output = str_replace('"', '&quot;', $output);

  // encode quote
  return $output;
}