File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -176,4 +176,12 @@ public static function query(): array
176
176
self ::$ args = \array_merge ($ url_args , $ body_args );
177
177
return self ::$ args ;
178
178
}
179
+
180
+ public static function serverName (): string
181
+ {
182
+ $ name = \getenv ('HTTP_HOST ' ) ?? '' ;
183
+ if (empty ($ name )) $ name = \getenv ('SERVER_NAME ' ) ?? '' ;
184
+ if (empty ($ name )) $ name = \getenv ('HOST ' ) ?? '' ;
185
+ return $ name ?? '' ;
186
+ }
179
187
}
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ public static function format(string $value): string
32
32
33
33
// Current request
34
34
$ current_scheme = 'http ' . ($ secure ? 's ' : '' ) . ': ' ;
35
- $ current_host = \getenv ( ' HTTP_HOST ' );
36
- $ current_path = \getenv ('DOCUMENT_URI ' );
37
- $ current_query = \getenv ('QUERY_STRING ' );
35
+ $ current_host = \BNETDocs \ Libraries \ Core \Router:: serverName ( );
36
+ $ current_path = \getenv ('DOCUMENT_URI ' ) ?? '' ;
37
+ $ current_query = \getenv ('QUERY_STRING ' ) ?? '' ;
38
38
39
39
// Placeholders
40
40
$ scheme = null ;
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ if (!empty($tpl_referer))
61
61
{
62
62
$ tpl_referer = '<a href=" ' . filter_var ($ tpl_referer , FILTER_SANITIZE_FULL_SPECIAL_CHARS ) . '"><< Back to Previous</a> ' ;
63
63
}
64
- if (stripos ($ tpl_referer , getenv ( ' HTTP_HOST ' )) === false )
64
+ if (stripos ($ tpl_referer , \ BNETDocs \ Libraries \ Core \Router:: serverName ( )) === false )
65
65
{
66
66
$ tpl_referer = '' ;
67
67
}
You can’t perform that action at this time.
0 commit comments