diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index de54dac..54e89ea 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -1280,7 +1280,8 @@ public function renderText($alter) { $value = nl2br($value); } - // Preserve whether or not the string is safe. + // Preserve whether or not the string is safe. Since $suffix comes from + // \Drupal::l(), it is safe to append. if ($value_is_safe) { $value = SafeString::create($value . $suffix); } @@ -1293,11 +1294,14 @@ public function renderText($alter) { $value = $this->renderAsLink($alter, $value, $tokens); } - // Preserve whether or not the string is safe. + // Preserve whether or not the string is safe. Since $suffix comes from + // \Drupal::l(), it is safe to append. if ($value_is_safe) { return SafeString::create($value . $suffix); } else { + // If the string is not already marked safe, it is still OK to return it + // because it will be sanitized by Twig. return $value . $suffix; } }