Same name and namespace in other branches
  1. 8.x-2.x src/ExifContent.php \Drupal\exif\ExifContent::sanitizeValue() 1 comment

Ensure no HTML or Javascript will be interpreted in the rendering process.

Parameters

string $exif_value: The value retrieve from the image.

Return value

string The value sanitized.

2 calls to ExifContent::sanitizeValue()
ExifContent::entity_insert_update in src/ExifContent.php
Main entry of the module.
ExifContent::handleField in src/ExifContent.php
Handle field by delegating to specific type handler.

File

src/ExifContent.php, line 418

Class

ExifContent
Class ExifContent make link between drupal content and file content.

Namespace

Drupal\exif

Code

private function sanitizeValue($exif_value) {
    if (!Unicode::validateUtf8($exif_value)) {
        $exif_value = Html::escape(utf8_encode($exif_value));
    }
    return $exif_value;
}