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&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().
Comment | File | Size | Author |
---|---|---|---|
#4 | 3247935-do-not-html-encode-link-http-header-4.patch | 2.07 KB | mfb |
Comments
Comment #2
mfbOoops this is now a duplicate of #2959727: drupal_add_html_head_link() needs to allow multiple hreflang tags to point to one URL.
Comment #3
mfbReopening in case this will be separated out from #2959727: drupal_add_html_head_link() needs to allow multiple hreflang tags to point to one URL.
Comment #4
mfbAdding test
Comment #6
mcdruidGreat, thank you!