Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#33092 closed defect (bug) (invalid)

Media Library uploads don't take HTTPS into account

Reported by: janr's profile JanR Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: Media Keywords:
Focuses: Cc:

Description

When uploading an image through the Media Library, and inserting it into a post, SSL/HTTPS isn't taken into account in the URL. This causes mixed content warnings in browsers if you forget to manually change the URL to https.

Reproducible: always

Steps to reproduce:

  • have your WordPress site and Dashboad over SSL/HTTPS
  • upload an image using the Media Library
  • notice the attachment URL being "HTTP".

And:

  • insert an image into a post, the URL stays http://, in stead of https://.

Attachments (1)

MediaLibrary_SSL.png (112.6 KB) - added by JanR 9 years ago.

Download all attachments as: .zip

Change History (4)

@JanR
9 years ago

#1 follow-up: @boonebgorges
9 years ago

Can you give more details about your site configuration? Attachment URLs are built using your 'siteurl', which is the value in the "WordPress Address (URL)" field on wp-admin/options-general.php. I'm assuming that, on your site, this value is *not* https. Is HTTPS optional on your site? Are you forcing it at the webserver level?

#2 in reply to: ↑ 1 @JanR
9 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Replying to boonebgorges:

Can you give more details about your site configuration? Attachment URLs are built using your 'siteurl', which is the value in the "WordPress Address (URL)" field on wp-admin/options-general.php. I'm assuming that, on your site, this value is *not* https. Is HTTPS optional on your site? Are you forcing it at the webserver level?

I'm not sure whether it matters, I'm running a multisite instance with the domain mapper plugin. I added sub domains, which I changed to full domains through Edit Site.

All domains are listed with HTTPS in 'Site URL' under 'Info', but apparently not under 'Settings' tab (honest, I've never noticed nor checked that, my bad). This ticket can be closed.

For future reference (to whom might stumble upon this ticket):

MariaDB [dbname]> SELECT option_id,option_value FROM wp_5_options where option_value LIKE "%cdn.saotn.org";
+-----------+----------------------+
| option_id | option_value         |
+-----------+----------------------+
|         1 | http://cdn.saotn.org |
|         2 | http://cdn.saotn.org |
|       108 | http://cdn.saotn.org |
+-----------+----------------------+
3 rows in set (0.00 sec)

MariaDB [dbname]> SELECT option_id,option_value FROM wp_3_options where option_value LIKE "%www.itfaq.nl/";
+-----------+----------------------+
| option_id | option_value         |
+-----------+----------------------+
|         1 | http://www.itfaq.nl/ |
|         2 | http://www.itfaq.nl/ |
+-----------+----------------------+
2 rows in set (0.00 sec)

MariaDB [dbname]> SELECT option_id,option_value FROM wp_options where option_value LIKE "%www.saotn.org";
+-----------+-----------------------+
| option_id | option_value          |
+-----------+-----------------------+
|         1 | http://www.saotn.org  |
|        36 | http://www.saotn.org  |
|    305348 | https://www.saotn.org |
+-----------+-----------------------+
3 rows in set (0.01 sec)

Updating the option_value records will resolve this. I'll mark this ticket as resolve as invalid, my apologies.

#3 @boonebgorges
9 years ago

  • Milestone Awaiting Review deleted

No apologies necessary - glad you got it sorted.

Note: See TracTickets for help on using tickets.