Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a site which runs on AdaptiveTheme with Google fonts loaded via the theme's Appearance Settings page. Specifically I have a default font of Montserrat and the titles all set to Cinzel:700.
The HTML produced for the Google font api link does not validate on w3.validator.org.
<link type="text/css" rel="stylesheet" href="//fonts.googleapis.com/css?family=Montserrat|Cinzel:700" media="all" />
Produces an error that | is an invalid character for href.
It should be encoded as %7C. I've fixed my local copy in load.inc by changing
$google_fonts = implode('|', $used_fonts);
to
$google_fonts = implode('%7C', $used_fonts);
Not sure if that's the best way to fix it as presumably the whole href should be encoded but I hope it helps someone.
Comments
Comment #2
Jeff Burnz CreditAttribution: Jeff Burnz commentedThis seems like a reasonable fix to me. Good find, and thanks for the bug report!
Comment #3
Jeff Burnz CreditAttribution: Jeff Burnz commented