Problem/Motivation

drupal_add_html_head_link() is HTML-encoding the URL in the link HTTP header, but data in HTTP headers should not be HTML-encoded.

Steps to reproduce

drupal_add_html_head_link(array('href' => '/foo?bar=baz&baz=false', 'rel' => 'alternate'), TRUE);

The link HTTP header is sent as Link: </foo?bar=baz&amp;baz=false>; rel="alternate" but should be Link: </foo?bar=baz&baz=false>; rel="alternate"

Proposed resolution

Don't HTML-encode the URL in the link HTTP header; this aligns with the rest of the header which is generated by drupal_http_header_attributes(), which correctly does not HTML-encode the data in the header. The URL in the link HTML element will still be correctly HTML-encoded by drupal_attributes().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mfb created an issue. See original summary.

mfb’s picture

Status: Needs review » Closed (duplicate)
mfb’s picture

Status: Closed (duplicate) » Needs review

  • mcdruid committed d563595 on 7.x
    Issue #3247935 by mfb: drupal_add_html_head_link(): URL in link HTTP...
mcdruid’s picture

Status: Needs review » Fixed

Great, thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.