You are here

function _views_xhtml_strip_illegal_xml_attribute_value_chars in Views Datasource 7

Same name and namespace in other branches
  1. 6 views_xhtml.module \_views_xhtml_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.

File

./views_xhtml.module, line 180
Module definition for views_xhtml

Code

function _views_xhtml_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;
}