diff -u b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php --- b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -1220,7 +1220,7 @@ // We need to preserve the safeness of the value regardless of the // alterations made by this method. Any alterations or replacements made // within this method need to ensure that at the minimum the result is - // Xss admin filtered. See self::renderAltered() as an exmaple that does. + // XSS admin filtered. See self::renderAltered() as an example that does. $value_is_safe = SafeMarkup::isSafe($this->last_render); // Cast to a string so that empty checks and string functions work as // expected. diff -u b/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php --- b/core/tests/Drupal/Tests/Core/Render/RendererTest.php +++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php @@ -36,6 +36,18 @@ ]; /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + // Reset the static list of SafeStrings to prevent bleeding between tests. + $reflected_class = new \ReflectionClass('\Drupal\Component\Utility\SafeMarkup'); + $reflected_property = $reflected_class->getProperty('safeStrings'); + $reflected_property->setAccessible(true); + $reflected_property->setValue([]); + } + + /** * @covers ::render * @covers ::doRender *