Commit d73aceb 1 parent 1c55d4a commit d73aceb Copy full SHA for d73aceb
File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 115
115
}
116
116
}
117
117
118
- define ('SERVER_URL ' , 'http ' . (isset ( $ _SERVER [ ' HTTPS ' ][ 0 ]) && strtolower ( $ _SERVER [ ' HTTPS ' ]) === ' on ' ? 's ' : '' ) . ':// ' . $ baseHost );
118
+ define ('SERVER_URL ' , 'http ' . (isHttps () ? 's ' : '' ) . ':// ' . $ baseHost );
119
119
define ('BASE_URL ' , SERVER_URL . BASE_DIR . '/ ' );
120
120
define ('ADMIN_URL ' , SERVER_URL . BASE_DIR . '/admin/ ' );
121
121
125
125
}
126
126
}
127
127
require SYSTEM . 'autoload.php ' ;
128
+
129
+ function isHttps (): bool
130
+ {
131
+ return
132
+ (!empty ($ _SERVER ['HTTP_X_FORWARDED_PROTO ' ]) && strtolower ($ _SERVER ['HTTP_X_FORWARDED_PROTO ' ]) === 'https ' )
133
+ || (!empty ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] !== 'off ' )
134
+ || (isset ($ _SERVER ['SERVER_PORT ' ]) && (int ) $ _SERVER ['SERVER_PORT ' ] === 443 );
135
+ }
You can’t perform that action at this time.
0 commit comments