Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#21399 closed defect (bug) (fixed)

Twenty Twelve: use protocol relative URL to load Google Fonts

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


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 3 years ago.
21399.2.diff (793 bytes) - added by obenland 3 years ago.
Adds is_ssl() check
21399.3.diff (1.1 KB) - added by obenland 3 years ago.
Version check with is_ssl() as fallback

Download all attachments as: .zip

Change History (7)

@lancewillett3 years ago

comment:1 follow-up: @obenland3 years ago

  • Cc konstantin@… added

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

comment:2 in reply to: ↑ 1 @lancewillett3 years 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?

comment:3 @nacin3 years ago

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 3 years ago by nacin (previous) (diff)

@obenland3 years ago

Adds is_ssl() check

@obenland3 years ago

Version check with is_ssl() as fallback

comment:4 @lancewillett3 years ago

  • 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.