From 83a6d5c3de2b8d189801f4a58f6fc3fe34dfeff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Fri, 12 Dec 2025 01:42:50 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=82=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Site/Controller/User.php | 1 - src/Site/Lib/Auth.php | 6 +++--- util.php | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Site/Controller/User.php b/src/Site/Controller/User.php index c22dd07..f0055a4 100644 --- a/src/Site/Controller/User.php +++ b/src/Site/Controller/User.php @@ -173,7 +173,6 @@ class User { $tmpl->assign('custCss', false); $tmpl->assign('menu', $this->getMenu()); $tmpl->assign('description', $description); - $tmpl->assign('error', $error); $tmpl->assign('user', $user); $tmpl->assign('u', $u); diff --git a/src/Site/Lib/Auth.php b/src/Site/Lib/Auth.php index 4f6f80e..e3700c1 100644 --- a/src/Site/Lib/Auth.php +++ b/src/Site/Lib/Auth.php @@ -189,7 +189,7 @@ class Auth { $user = new \stdClass; $user->id = $lastId; $user->username = $username; - $user->password = password_hash($password, $algo); + $user->password = password_hash($password, $this->algo); $user->avatar = ''; $user->email = $email; $user->regDate = time(); @@ -219,8 +219,8 @@ class Auth { return \Result::Error('エラー:ユーザー名又はパスワードが一致していません。'); } - if (password_needs_rehash($userData->password, $algo)) { - $userData->password = password_hash($password, $algo); + if (password_needs_rehash($userData->password, $this->algo)) { + $userData->password = password_hash($password, $this->algo); $path = $this->dataDir.$this->id.'.'.$userData->username.'.json'; $json = json_encode($userData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); diff --git a/util.php b/util.php index d371950..65d38a3 100644 --- a/util.php +++ b/util.php @@ -33,7 +33,9 @@ function uuid(): string { function kys(mixed $arg): void { if (gettype($arg) == 'boolean') $arg = $arg === true ? 'true' : 'false'; - foreach ($arg as $a) { if (gettype($a) == 'boolean') $a = $a === true ? 'true' : 'false'; } + if (gettype($arg) == 'array' || gettype($arg) == 'object') { + foreach ($arg as $a) { if (gettype($a) == 'boolean') $a = $a === true ? 'true' : 'false'; } + } echo ''; echo '
KILL
YOUR
SELF
'; echo '
';