#21399 closed defect (bug) (fixed)

Twenty Twelve: use protocol relative URL to load Google Fonts

Reported by: lancewillett Owned by: lancewillett
Priority: normal Milestone: 3.5
Component: Bundled Theme Version:
Severity: normal Keywords: has-patch
Cc: konstantin@…

Description

To avoid insecure content errors in Theme Customizer we should use relative protocol URL in the font CSS enqueue call.

Attachments (3)

21399.diff (650 bytes) - added by lancewillett 10 months ago.
21399.2.diff (793 bytes) - added by obenland 10 months ago.
Adds is_ssl() check
21399.3.diff (1.1 KB) - added by obenland 10 months ago.
Version check with is_ssl() as fallback

Download all attachments as: .zip

Change History (7)

comment:1 follow-up: ↓ 2   obenland10 months ago

  • Cc konstantin@… added

Won't this mess with back-compat? It was only introduced in [21166].

comment:2 in reply to: ↑ 1   lancewillett10 months ago

Replying to obenland:

Won't this mess with back-compat? It was only introduced in [21166].

We'd need to test to see how older versions of WP would react. The alternate is to check is_ssl() and output the correct protocol in the path. Which is not as elegant, but works.

@nacin, any thoughts?

Prior to 3.5, // is considered a path-relative URL, and the site URL is prepended. So that's a no-go.

We could consider a version check, and then register // if we're good, and otherwise, checking is_ssl(). Not as elegant as a straight is_ssl() check, but at least sets the expectation that you can now do // with enqueues.

Might complicate the theme more than it should, though. I'm fine with a straight is_ssl() check.

Last edited 10 months ago by nacin (previous) (diff)

Adds is_ssl() check

Version check with is_ssl() as fallback

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

In [21391]:

Twenty Twelve: use is_ssl() to load the correct protocol for Google font CSS file. Fixes #21399, props obenland.

Note: See TracTickets for help on using tickets.