From 909b7863f79d2466f884f9bc109b15c008a48211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0pa=C4=8Dek?= Date: Sun, 28 Sep 2025 05:08:27 +0200 Subject: [PATCH] Lowercase the host_info in remote address check In my case host_info returns "Localhost via UNIX socket" meaning "Localhost" won't be found in the $localhosts array. "Localhost" is also mentioned in https://www.php.net/manual/en/mysqli.get-host-info.php in the example output. --- adminer-plugins/remoteColor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer-plugins/remoteColor.php b/adminer-plugins/remoteColor.php index d35cdda..69c94ea 100644 --- a/adminer-plugins/remoteColor.php +++ b/adminer-plugins/remoteColor.php @@ -13,7 +13,7 @@ public function head() $connection = Adminer\connection(); if ( (isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !isset($_SERVER['REMOTE_ADDR']) || !in_array($_SERVER['REMOTE_ADDR'], $localhosts, true)) - || ($connection instanceof mysqli && !in_array(explode(' ', $connection->host_info)[0], $localhosts, true)) + || ($connection instanceof mysqli && !in_array(strtolower(explode(' ', $connection->host_info)[0]), $localhosts, true)) ) { echo 'document.documentElement.className+=" remote";'; }