File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,12 @@ function s24_load_environment_config() {
43
43
44
44
// Define ENV from hostname
45
45
if (!defined ('WP_ENV ' )) {
46
- if (isset ($ _SERVER ['HTTP_X_FORWARDED_HOST ' ]) && !empty ($ _SERVER ['HTTP_X_FORWARDED_HOST ' ])) {
47
- $ hostname = strtolower (filter_var ($ _SERVER ['HTTP_X_FORWARDED_HOST ' ], FILTER_SANITIZE_STRING ));
46
+ if (!empty ($ _SERVER ['HTTP_X_FORWARDED_HOST ' ])) {
47
+ $ hostname = strtolower (trim (strip_tags ($ _SERVER ['HTTP_X_FORWARDED_HOST ' ])));
48
+ } elseif (!empty ($ _SERVER ['HTTP_HOST ' ])) {
49
+ $ hostname = strtolower (trim (strip_tags ($ _SERVER ['HTTP_HOST ' ])));
48
50
} else {
49
- $ hostname = strtolower ( filter_var ( $ _SERVER [ ' HTTP_HOST ' ], FILTER_SANITIZE_STRING ) );
51
+ throw new Exception ( " Hostname is not available. " );
50
52
}
51
53
}
52
54
You can’t perform that action at this time.
0 commit comments