Same name in other branches
- 8.x-1.x src/Controller/ExifSettingsController.php \Drupal\exif\Controller\ExifSettingsController::sanitizeValue()
Escape a string by using HTML entities.
Paramètres
string $exif_value: UTF8 values to be escaped.
Return value
string value with HTML Entities.
1 call to ExifSettingsController::sanitizeValue()
- ExifSettingsController::showSample dans src/
Controller/ ExifSettingsController.php - Create a sample HTML Fragment.
Fichier
-
src/
Controller/ ExifSettingsController.php, line 583
Classe
- ExifSettingsController
- Class ExifSettingsController manage action of settings pages.
Namespace
Drupal\exif\ControllerCode
protected function sanitizeValue($exif_value) {
if (is_null($exif_value)) {
return '';
}
if (is_array($exif_value)) {
$strs = array_map([
$this,
'sanitizeValue',
], $exif_value);
return '[' . implode(',', $strs) . ']';
}
elseif (!Unicode::validateUtf8($exif_value)) {
$exif_value = Html::escape(utf8_encode($exif_value));
}
return $exif_value;
}