[wp-trac] [WordPress Trac] #40771: Unable to add YouTube video to Video Widget

WordPress Trac noreply at wordpress.org
Tue May 16 20:01:24 UTC 2017


#40771: Unable to add YouTube video to Video Widget
--------------------------+--------------------------
 Reporter:  taijacg       |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Widgets       |     Version:  trunk
 Severity:  normal        |  Resolution:  duplicate
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------------

Comment (by westonruter):

 @jnylen0 re: #34299, at the risk of restating things, the problem is that
 `is_ssl()` simply does not reliably return whether or not the user's
 browser is connected via HTTPS. As noted in #31288, when a HTTPS
 termination is done at a proxy then `is_ssl()` will return `false` and the
 only PHP solutions I'm aware of are to start looking at environment vars
 that the proxy sets, such as `$_SERVER['HTTP_X_FORWARDED_PROTO']` or
 `$_SERVER['HTTP_X_SSL']`. The reason these headers are not looked at in
 `is_ssl()` is explained in #31288. And the cause for why the protocol
 isn't matching in the admin context is that the `rest_url` is constructed
 off of the `home_url` and not the (admin) `site_url`, where the latter
 would always be HTTPS if `force_ssl_admin()`.

 So I think we either strip the protocol from the URL returned by
 `rest_url()`, or before we switch the browser's actual scheme on the
 client with JS.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40771#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list