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
176176 self ::$ args = \array_merge ($ url_args , $ body_args );
177177 return self ::$ args ;
178178 }
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+ }
179187}
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ public static function format(string $value): string
3232
3333 // Current request
3434 $ 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 ' ) ?? '' ;
3838
3939 // Placeholders
4040 $ scheme = null ;
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ if (!empty($tpl_referer))
6161{
6262 $ tpl_referer = '<a href=" ' . filter_var ($ tpl_referer , FILTER_SANITIZE_FULL_SPECIAL_CHARS ) . '"><< Back to Previous</a> ' ;
6363}
64- if (stripos ($ tpl_referer , getenv ( ' HTTP_HOST ' )) === false )
64+ if (stripos ($ tpl_referer , \ BNETDocs \ Libraries \ Core \Router:: serverName ( )) === false )
6565{
6666 $ tpl_referer = '' ;
6767}
You can’t perform that action at this time.
0 commit comments