diff --git a/core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php index ef0123e08c05501a5c8e80cd11cf1972e8240769..7c641fbc73ace23444410c33309bc3a1e75655b4 100644 --- a/core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php @@ -124,7 +124,7 @@ public function onException(ExceptionEvent $event) { $content_type = $event->getRequest()->getRequestFormat() == 'html' ? 'text/html' : 'text/plain'; $content = $this->t('The website encountered an unexpected error. Please try again later.'); - $content .= $message ? '</br></br>' . $message : ''; + $content .= $message ? '<br><br>' . $message : ''; $response = new Response($content, 500, ['Content-Type' => $content_type]); if ($exception instanceof HttpExceptionInterface) { diff --git a/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php b/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php index f43451ec63dfd450528844fb2842a75b937953bc..12259d8dba2763cb5dc1edf98b5c3459d0da5e41 100644 --- a/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php +++ b/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php @@ -104,7 +104,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta $form['entity_types_container']['entity_types'][$entity_type->id()] = [ 'type' => [ '#type' => 'inline_template', - '#template' => '<strong>{{ label }}</strong></br><span id="selected-{{ entity_type_id }}">{{ selected_bundles }}</span>', + '#template' => '<strong>{{ label }}</strong><br><span id="selected-{{ entity_type_id }}">{{ selected_bundles }}</span>', '#context' => [ 'label' => $this->t('@bundle types', ['@bundle' => $entity_type->getLabel()]), 'entity_type_id' => $entity_type->id(), diff --git a/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php b/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php index f760d71b226045aaa0a16277e23e3e4994b6b22e..d8b1c41635272ccbfc53cfe32e07cb3e8b7590d7 100644 --- a/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php +++ b/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php @@ -199,7 +199,7 @@ public function testExceptionEscaping() { // final exception subscriber, it is printed as partial HTML, and hence // escaped. $this->assertEquals('text/plain; charset=UTF-8', $response->headers->get('Content-type')); - $this->assertStringStartsWith('The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException</em>: Not acceptable format: json<script>alert(123);</script> in <em class="placeholder">', $response->getContent()); + $this->assertStringStartsWith('The website encountered an unexpected error. Please try again later.<br><br><em class="placeholder">Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException</em>: Not acceptable format: json<script>alert(123);</script> in <em class="placeholder">', $response->getContent()); } } diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php index c4a11cf822dab8db46b4bd9537cc224f3c819719..62bccf4971263bc9b44044069883f4f7eccaa252 100644 --- a/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php @@ -35,7 +35,7 @@ public function testOnExceptionWithUnknownFormat() { $response = $event->getResponse(); $this->assertInstanceOf(Response::class, $response); - $this->stringStartsWith('The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException</em>: test message in ', $response->getContent()); + $this->stringStartsWith('The website encountered an unexpected error. Please try again later.<br><br><em class="placeholder">Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException</em>: test message in ', $response->getContent()); $this->assertEquals(405, $response->getStatusCode()); $this->assertEquals('POST, PUT', $response->headers->get('Allow')); // Also check that the text/plain content type was added.