Loading core/lib/Drupal/Core/Render/Renderer.php +2 −2 Changes for core/lib/Drupal/Core/Render/Renderer.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -518,7 +518,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) { $prefix = isset($elements['#prefix']) ? $this->xssFilterAdminIfUnsafe($elements['#prefix']) : ''; $suffix = isset($elements['#suffix']) ? $this->xssFilterAdminIfUnsafe($elements['#suffix']) : ''; $elements['#markup'] = SafeString::create($prefix . $elements['#children'] . $suffix); $elements['#markup'] = $prefix . $elements['#children'] . $suffix; // We've rendered this element (and its subtree!), now update the context. $context->update($elements); Loading Loading @@ -553,7 +553,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) { $context->bubble(); $elements['#printed'] = TRUE; return $elements['#markup']; return SafeString::create($elements['#markup']); } /** Loading core/lib/Drupal/Core/Theme/ThemeManager.php +3 −7 Changes for core/lib/Drupal/Core/Theme/ThemeManager.php: 3 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -7,13 +7,12 @@ namespace Drupal\Core\Theme; use Drupal\Component\Utility\SafeStringInterface; use Drupal\Core\Render\SafeString; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\StackedRouteMatchInterface; use Symfony\Component\HttpFoundation\RequestStack; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Template\Attribute; use Drupal\Component\Utility\SafeMarkup; /** * Provides the default implementation of a theme manager. Loading Loading @@ -318,10 +317,7 @@ public function render($hook, array $variables) { $output = ''; if (isset($info['function'])) { if (function_exists($info['function'])) { // Theme functions do not render via the theme engine, so the output is // not autoescaped. However, we can only presume that the theme function // has been written correctly and that the markup is safe. $output = SafeString::create($info['function']($variables)); $output = SafeMarkup::set($info['function']($variables)); } } else { Loading Loading @@ -391,7 +387,7 @@ public function render($hook, array $variables) { $output = $render_function($template_file, $variables); } return ($output instanceof SafeStringInterface) ? $output : (string) $output; return (string) $output; } /** Loading core/lib/Drupal/Core/Theme/ThemeManagerInterface.php +2 −2 Changes for core/lib/Drupal/Core/Theme/ThemeManagerInterface.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ interface ThemeManagerInterface { * @param array $variables * An associative array of theme variables. * * @return string|\Drupal\Component\Utility\SafeStringInterface * The rendered output, or a SafeString object. * @return string * The rendered output. */ public function render($hook, array $variables); Loading core/modules/comment/src/Tests/Views/CommentFieldNameTest.php +2 −2 Changes for core/modules/comment/src/Tests/Views/CommentFieldNameTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -91,11 +91,11 @@ public function testCommentFieldName() { $output = $renderer->executeInRenderContext(new RenderContext(), function () use ($view) { return $view->field['field_name']->advancedRender($view->result[0]); }); $this->assertEqual($this->comment->getFieldName(), $output); $this->assertIdentical($this->comment->getFieldName(), $output); $output = $renderer->executeInRenderContext(new RenderContext(), function () use ($view) { return $view->field['field_name']->advancedRender($view->result[1]); }); $this->assertEqual($this->customComment->getFieldName(), $output); $this->assertIdentical($this->customComment->getFieldName(), $output); } } core/modules/serialization/serialization.services.yml −4 Changes for core/modules/serialization/serialization.services.yml: 0 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -30,10 +30,6 @@ services: arguments: ['Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem'] tags: - { name: normalizer, priority: 20 } serializer.normalizer.safe_string: class: Drupal\serialization\Normalizer\SafeStringNormalizer tags: - { name: normalizer } serializer.normalizer.typed_data: class: Drupal\serialization\Normalizer\TypedDataNormalizer tags: Loading Loading
core/lib/Drupal/Core/Render/Renderer.php +2 −2 Changes for core/lib/Drupal/Core/Render/Renderer.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -518,7 +518,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) { $prefix = isset($elements['#prefix']) ? $this->xssFilterAdminIfUnsafe($elements['#prefix']) : ''; $suffix = isset($elements['#suffix']) ? $this->xssFilterAdminIfUnsafe($elements['#suffix']) : ''; $elements['#markup'] = SafeString::create($prefix . $elements['#children'] . $suffix); $elements['#markup'] = $prefix . $elements['#children'] . $suffix; // We've rendered this element (and its subtree!), now update the context. $context->update($elements); Loading Loading @@ -553,7 +553,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) { $context->bubble(); $elements['#printed'] = TRUE; return $elements['#markup']; return SafeString::create($elements['#markup']); } /** Loading
core/lib/Drupal/Core/Theme/ThemeManager.php +3 −7 Changes for core/lib/Drupal/Core/Theme/ThemeManager.php: 3 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -7,13 +7,12 @@ namespace Drupal\Core\Theme; use Drupal\Component\Utility\SafeStringInterface; use Drupal\Core\Render\SafeString; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\StackedRouteMatchInterface; use Symfony\Component\HttpFoundation\RequestStack; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Template\Attribute; use Drupal\Component\Utility\SafeMarkup; /** * Provides the default implementation of a theme manager. Loading Loading @@ -318,10 +317,7 @@ public function render($hook, array $variables) { $output = ''; if (isset($info['function'])) { if (function_exists($info['function'])) { // Theme functions do not render via the theme engine, so the output is // not autoescaped. However, we can only presume that the theme function // has been written correctly and that the markup is safe. $output = SafeString::create($info['function']($variables)); $output = SafeMarkup::set($info['function']($variables)); } } else { Loading Loading @@ -391,7 +387,7 @@ public function render($hook, array $variables) { $output = $render_function($template_file, $variables); } return ($output instanceof SafeStringInterface) ? $output : (string) $output; return (string) $output; } /** Loading
core/lib/Drupal/Core/Theme/ThemeManagerInterface.php +2 −2 Changes for core/lib/Drupal/Core/Theme/ThemeManagerInterface.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ interface ThemeManagerInterface { * @param array $variables * An associative array of theme variables. * * @return string|\Drupal\Component\Utility\SafeStringInterface * The rendered output, or a SafeString object. * @return string * The rendered output. */ public function render($hook, array $variables); Loading
core/modules/comment/src/Tests/Views/CommentFieldNameTest.php +2 −2 Changes for core/modules/comment/src/Tests/Views/CommentFieldNameTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -91,11 +91,11 @@ public function testCommentFieldName() { $output = $renderer->executeInRenderContext(new RenderContext(), function () use ($view) { return $view->field['field_name']->advancedRender($view->result[0]); }); $this->assertEqual($this->comment->getFieldName(), $output); $this->assertIdentical($this->comment->getFieldName(), $output); $output = $renderer->executeInRenderContext(new RenderContext(), function () use ($view) { return $view->field['field_name']->advancedRender($view->result[1]); }); $this->assertEqual($this->customComment->getFieldName(), $output); $this->assertIdentical($this->customComment->getFieldName(), $output); } }
core/modules/serialization/serialization.services.yml −4 Changes for core/modules/serialization/serialization.services.yml: 0 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -30,10 +30,6 @@ services: arguments: ['Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem'] tags: - { name: normalizer, priority: 20 } serializer.normalizer.safe_string: class: Drupal\serialization\Normalizer\SafeStringNormalizer tags: - { name: normalizer } serializer.normalizer.typed_data: class: Drupal\serialization\Normalizer\TypedDataNormalizer tags: Loading