mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fix ssl checker for load balancers
This commit is contained in:
+7
-1
@@ -96,7 +96,13 @@ class UM_Files {
|
||||
$this->upload_basedir = apply_filters('um_upload_basedir_filter', $this->upload_basedir );
|
||||
$this->upload_baseurl = apply_filters('um_upload_baseurl_filter', $this->upload_baseurl );
|
||||
|
||||
if( is_ssl() ){
|
||||
// @note : is_ssl() doesn't work properly for some sites running with load balancers
|
||||
// Check the links for more info about this bug
|
||||
// https://codex.wordpress.org/Function_Reference/is_ssl
|
||||
// http://snippets.webaware.com.au/snippets/wordpress-is_ssl-doesnt-work-behind-some-load-balancers/
|
||||
if( is_ssl() || stripos( get_option( 'siteurl' ), 'https://' ) !== false
|
||||
|| ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
|
||||
&& $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) ) {
|
||||
$this->upload_baseurl = str_replace("http://", "https://", $this->upload_baseurl);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user