bfintal / bfi_thumb

WP Image Resizer & a replacement for Timthumb. Extends and uses the default capabilities of WordPress' Image Editors to add some basic Timthumb capabilities.
http://bfintal.github.com/bfi_thumb/
GNU General Public License v3.0
206 stars 53 forks source link

Doesn't work on https #33

Open darkolaz opened 7 years ago

darkolaz commented 7 years ago

Hello,

I have issue with bfi_thumb under secure domain. Everything works very well when the website is open normally and not forced under https. When i try to get the bfi_thumb url it returns the original url and ignoring the bfi_thumb parameters.

darkolaz commented 7 years ago

After debagging i found out that $upload_url = $upload_info['baseurl'] is always http. The problem is in wp_upload_url(), it's not working like it's supposed to.

I simply added this on line 404 and my problem was solved:

if($_SERVER['SERVER_PORT'] == '443' && strpos( $upload_url, 'https' ) === false){ $upload_url = str_replace('http', 'https', $upload_url); }