Loading core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php +5 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,6 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Form\EnforcedResponseException; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Component\Utility\Html; use Symfony\Component\HttpFoundation\RequestStack; /** Loading Loading @@ -413,7 +412,10 @@ protected function processHtmlHead(array $html_head) { * @param array $html_head_link * The 'html_head_link' value of a render array. Each head link is specified * by a two-element array: * - An array specifying the attributes of the link. * - An array specifying the attributes of the link. The 'href' and 'rel' * attributes are required, and the 'href' attribute is expected to be a * percent-encoded URI for proper serialization in the Link: HTTP header, * as specified by RFC 8288. * - A boolean specifying whether the link should also be a Link: HTTP * header. * Loading Loading @@ -448,7 +450,7 @@ protected function processHtmlHeadLink(array $html_head_link) { if ($should_add_header) { // Also add a HTTP header "Link:". $href = '<' . Html::escape($attributes['href']) . '>'; $href = '<' . $attributes['href'] . '>'; unset($attributes['href']); if ($param = static::formatHttpHeaderAttributes($attributes)) { $href .= ';' . $param; Loading core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public function testAttachments() { // Test ['#attached']['html_head_link'] when outputted as HTTP header. $this->drupalGet('/render_attached_test/html_header_link'); $expected_link_headers = [ '</foo?bar=<baz>&baz=false>; rel="alternate"', '</foo?bar=<baz>&baz=false>; rel="alternate"', '</foo/bar>; hreflang="nl"; rel="alternate"', '</foo/bar>; hreflang="de"; rel="alternate"', ]; Loading Loading
core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php +5 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,6 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Form\EnforcedResponseException; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Component\Utility\Html; use Symfony\Component\HttpFoundation\RequestStack; /** Loading Loading @@ -413,7 +412,10 @@ protected function processHtmlHead(array $html_head) { * @param array $html_head_link * The 'html_head_link' value of a render array. Each head link is specified * by a two-element array: * - An array specifying the attributes of the link. * - An array specifying the attributes of the link. The 'href' and 'rel' * attributes are required, and the 'href' attribute is expected to be a * percent-encoded URI for proper serialization in the Link: HTTP header, * as specified by RFC 8288. * - A boolean specifying whether the link should also be a Link: HTTP * header. * Loading Loading @@ -448,7 +450,7 @@ protected function processHtmlHeadLink(array $html_head_link) { if ($should_add_header) { // Also add a HTTP header "Link:". $href = '<' . Html::escape($attributes['href']) . '>'; $href = '<' . $attributes['href'] . '>'; unset($attributes['href']); if ($param = static::formatHttpHeaderAttributes($attributes)) { $href .= ';' . $param; Loading
core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public function testAttachments() { // Test ['#attached']['html_head_link'] when outputted as HTTP header. $this->drupalGet('/render_attached_test/html_header_link'); $expected_link_headers = [ '</foo?bar=<baz>&baz=false>; rel="alternate"', '</foo?bar=<baz>&baz=false>; rel="alternate"', '</foo/bar>; hreflang="nl"; rel="alternate"', '</foo/bar>; hreflang="de"; rel="alternate"', ]; Loading