You are here

function exif_custom_check_plain in EXIF Custom 7

1 call to exif_custom_check_plain()
exif_custom_get_exif_fields in ./exif_custom.module

File

./exif_custom.module, line 409
Primary hook implementations for EXIF Custom.

Code

function exif_custom_check_plain($text) {
  if (is_null($text)) {
    $text = "";
  }
  if (!mb_detect_encoding($text, 'UTF-8', TRUE)) {
    $text = html_entity_decode($text);
    $text = mb_convert_encoding($text, 'UTF-8', 'ISO-8859-1');
    $text = str_replace('>', '>', $text);
    $text = str_replace('<', '&lt;', $text);
    $text = str_replace('&lt;br /&gt;', '\\n', $text);
  }
  return $text;

  // Removed as it stops italics in descriptions.
  // return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
}