[wp-trac] [WordPress Trac] #49970: Wrong is_ssl() result

WordPress Trac noreply at wordpress.org
Tue Apr 21 12:06:33 UTC 2020


#49970: Wrong is_ssl()  result
--------------------------+-----------------------------------
 Reporter:  duxabilii     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.4
 Severity:  normal        |   Keywords:  has-patch 2nd-opinion
  Focuses:                |
--------------------------+-----------------------------------
 wp-includes/load.php
 function is_ssl
 wrong result when use https load proxy as load balancer
 posible solution (in my case)
 {{{#!php
 <?php
 function is_ssl() {
         if ( isset( $_SERVER['HTTPS'] ) ) {
                 if ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) {
                         return true;
                 }

                 if ( '1' == $_SERVER['HTTPS'] ) {
                         return true;
                 }
         } elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' ==
 $_SERVER['SERVER_PORT'] ) ) {
                 return true;
         } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_PORT'] ) && ( '443'
 == $_SERVER['HTTP_X_FORWARDED_PORT'] ) ) {
                 return true;
         }
         return false;
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49970>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list