@@ -93,8 +93,15 @@ class Config
9393 /** @var array */
9494 public array $ defaultServer = [];
9595
96+ private bool $ isHttps ;
97+
9698 private Settings |null $ config = null ;
9799
100+ public function __construct ()
101+ {
102+ $ this ->isHttps = $ this ->isHttps ();
103+ }
104+
98105 /**
99106 * @param string|null $source source to read config from
100107 *
@@ -776,8 +783,9 @@ public function checkUploadSize(): void
776783 */
777784 public function isHttps (): bool
778785 {
779- if ($ this ->get ('is_https ' ) !== null ) {
780- return (bool ) $ this ->get ('is_https ' );
786+ $ is_https = $ this ->get ('is_https ' );
787+ if ($ is_https !== null ) {
788+ return (bool ) $ is_https ;
781789 }
782790
783791 $ url = $ this ->get ('PmaAbsoluteUri ' );
@@ -887,7 +895,7 @@ public function removeCookie(string $cookieName): bool
887895 time () - 3600 ,
888896 $ this ->getRootPath (),
889897 '' ,
890- $ this ->isHttps () ,
898+ $ this ->isHttps ,
891899 );
892900 }
893901
@@ -951,7 +959,7 @@ public function setCookie(
951959 'expires ' => $ validity ,
952960 'path ' => $ this ->getRootPath (),
953961 'domain ' => '' ,
954- 'secure ' => $ this ->isHttps () ,
962+ 'secure ' => $ this ->isHttps ,
955963 'httponly ' => $ httponly ,
956964 'samesite ' => $ cookieSameSite ,
957965 ];
@@ -982,7 +990,7 @@ public function getCookie(string $cookieName): mixed
982990 */
983991 public function getCookieName (string $ cookieName ): string
984992 {
985- return $ cookieName . ( $ this ->isHttps () ? '_https ' : '' );
993+ return $ cookieName . ( $ this ->isHttps ? '_https ' : '' );
986994 }
987995
988996 /**
0 commit comments