1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 14:46:36 +02:00

Fix type of permanentLogin()

This commit is contained in:
Jakub Vrana
2025-03-29 15:21:25 +01:00
parent 141db3cb8d
commit 6a3161cd49
2 changed files with 5 additions and 5 deletions

View File

@@ -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);

View File

@@ -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) {