[wp-trac] [WordPress Trac] #21973: 2 bugs in wp_enqueue_style

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 23 00:00:43 UTC 2012


#21973: 2 bugs in wp_enqueue_style
--------------------------+------------------------------
 Reporter:  thomask       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  blocker       |  Resolution:
 Keywords:                |
--------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> Current twenty twelve theme uses wp_enqueue_style for loading google
> fonts and it points to two bugs in wp_enqueue_style
>
> 1. it does not allow to add address without protocol. It is perfectly
> valid to use e.g.
> "//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700"
> and it would load http when you are running it from http server or https
> if you are using https. If you put this to wp_enqueue_style, it deletes
> one "/" from the begining and then it try to load it from
> 'yourserver.tld/fonts.googleapis.com/'
>
> 2. it has very funny and hard to notice bug for developers - when you are
> using with user logged on, it works OK. But when you are looking at the
> web logged off, it cut everything behind the ? char, so it will try to
> load 'http(s)://fonts.googleapis.com/css' and so in this case finishes
> with 404
>
> P.S.: i set it as a blocker, because future default theme twenty twelve
> uses this as default (what is wrong btw., see #21972)

New description:

 Current twenty twelve theme uses wp_enqueue_style for loading google fonts
 and it points to two bugs in wp_enqueue_style

 1. it does not allow to add address without protocol. It is perfectly
 valid to use e.g.
 `//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700`"
 and it would load http when you are running it from http server or https
 if you are using https. If you put this to wp_enqueue_style, it deletes
 one "/" from the begining and then it try to load it from
 'yourserver.tld/fonts.googleapis.com/'

 2. it has very funny and hard to notice bug for developers - when you are
 using with user logged on, it works OK. But when you are looking at the
 web logged off, it cut everything behind the ? char, so it will try to
 load `http(s)://fonts.googleapis.com/css` and so in this case finishes
 with 404

 P.S.: i set it as a blocker, because future default theme twenty twelve
 uses this as default (what is wrong btw., see #21972)

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21973#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list