(Bug 17970) {{PROTECTIONLEVEL}} should be able to return the status for pages besides...
[lhc/web/wiklou.git] / includes / WebRequest.php
index 8cf25bb..68d22a8 100644 (file)
@@ -192,7 +192,14 @@ class WebRequest {
         * @return array
         */
        public static function detectProtocolAndStdPort() {
-               return ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ? array( 'https', 443 ) : array( 'http', 80 );
+               if ( ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ||
+                       ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
+                       $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) ) {
+                       $arr = array( 'https', 443 );
+               } else {
+                       $arr = array( 'http', 80 );
+               }
+               return $arr;
        }
 
        /**
@@ -1307,6 +1314,10 @@ class FauxRequest extends WebRequest {
                return $this->wasPosted;
        }
 
+       public function getCookie( $key, $prefix = null, $default = null ) {
+               return $default;
+       }
+
        public function checkSessionCookie() {
                return false;
        }