1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 15:16:44 +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 /** 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 { function permanentLogin(bool $create = false): string {
return password_file($create); 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 /** 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"; $filename = get_temp_dir() . "/adminer.key";
if (!$create && !file_exists($filename)) { if (!$create && !file_exists($filename)) {
return false; return '';
} }
$fp = file_open_lock($filename); $fp = file_open_lock($filename);
if (!$fp) { if (!$fp) {
return false; return '';
} }
$return = stream_get_contents($fp); $return = stream_get_contents($fp);
if (!$return) { if (!$return) {