From 6a3161cd49a2277a50c8a1f08dbe4f66bdd9ae74 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sat, 29 Mar 2025 15:21:25 +0100 Subject: [PATCH] Fix type of permanentLogin() --- adminer/include/adminer.inc.php | 2 +- adminer/include/functions.inc.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index f2a41275..321be6bf 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -28,7 +28,7 @@ class Adminer { } /** Get key used for permanent login - * @return string cryptic string which gets combined with password or false in case of an error + * @return string cryptic string which gets combined with password or '' in case of an error */ function permanentLogin(bool $create = false): string { return password_file($create); diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 0fa8ef73..005f3dce 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -739,16 +739,16 @@ function first(array $array) { } /** Read password from file adminer.key in temporary directory or create one -* @return string|false false if the file can not be created +* @return string '' if the file can not be created */ -function password_file(bool $create) { +function password_file(bool $create): string { $filename = get_temp_dir() . "/adminer.key"; if (!$create && !file_exists($filename)) { - return false; + return ''; } $fp = file_open_lock($filename); if (!$fp) { - return false; + return ''; } $return = stream_get_contents($fp); if (!$return) {