diff -u b/core/includes/theme.inc b/core/includes/theme.inc --- b/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -364,7 +364,7 @@ * * You use this method in theme functions to ensure that the result is safe for * output inside HTML fragments. - * This mimics the behavior of the auto-escape fucntionality in Twig. + * This mimics the behavior of the auto-escape functionality in Twig. * * @param mixed $arg * The string, object, or render array to escape if needed. reverted: --- b/core/tests/Drupal/KernelTests/Core/Theme/ThemeAutoescapeTest.php +++ /dev/null @@ -1,86 +0,0 @@ -installSchema('system', 'router'); - \Drupal::service('router.builder')->rebuild(); - } - - /** - * Tests automatic escaping. - * - * @dataProvider providerTestThemeEscapeAndRender - */ - public function testThemeEscapeAndRender($arg, $expected) { - if (is_array($arg) && isset($arg['#type']) && $arg['#type'] === 'link') { - $arg = Link::createFromRoute($arg['#title'], $arg['#url']); - } - - /** @var \Drupal\Core\Render\RendererInterface $renderer */ - $renderer = \Drupal::service('renderer'); - $context = new RenderContext(); - $renderer->executeInRenderContext($context, function () use ($expected, $arg) { - $this->assertSame($expected, theme_escape_and_render($arg)); - }); - } - - /** - * Provide test examples. - */ - public function providerTestThemeEscapeAndRender() { - return [ - ['', ''], - ['a', 'a'], - ['>', '>'], - [SafeString::create('hi'), 'hi'], - [SafeString::create(''), ''], - ['hi', Html::escape('hi')], - [['#type' => 'link', '#title' => 'Text', '#url' => ''], 'Text'], - [['#markup' => 'hi'], 'hi'], - [ - '', - Html::escape('') - ], - ]; - } - - /** - * @expectedException \Exception - */ - public function testThemeEscapeAndRenderNotPrintable() { - theme_escape_and_render(new NonPrintable()); - } - -} - -class NonPrintable { } diff -u b/core/themes/engines/phptemplate/phptemplate.engine b/core/themes/engines/phptemplate/phptemplate.engine --- b/core/themes/engines/phptemplate/phptemplate.engine +++ b/core/themes/engines/phptemplate/phptemplate.engine @@ -6,11 +6,11 @@ * * Note: The PHP template engine is highly problematic, because each individual * template needs to take care of escaping for each variable manually, so using - * it, makes it really hard to provide safe output. Instead its highly - * encouraged to use the twig template engine instead. + * it makes it really hard to provide safe output. Instead it's highly + * encouraged to use the Twig template engine instead. * * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. - * The phptemplate engine is deprecated and replaced with the twig template + * The phptemplate engine is deprecated and replaced with the Twig template * engine. */ @@ -20,7 +20,7 @@ * Implements hook_init(). */ function phptemplate_init(Extension $theme) { - trigger_error('The php template engine is deprecated and should no longer be used. Use the twig template engine instead.', E_USER_DEPRECATED); + trigger_error('The php template engine is deprecated and should no longer be used. Use the Twig template engine instead.', E_USER_DEPRECATED); $theme->load(); }