aboutsummaryrefslogtreecommitdiff
path: root/app/Models/FormAuth.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-01-30 15:53:17 +0100
committerGravatar GitHub <noreply@github.com> 2022-01-30 15:53:17 +0100
commit47e242aa77bb8583e8716023c4bcef0462891ebd (patch)
tree05ca76b2459db75c9ae3236acbc6ec711fb5c7dd /app/Models/FormAuth.php
parent24afafb74d422bd8d7526719046253279cb7e713 (diff)
Fix ctype_alnum (#4182)
* Fix ctype_alnum #fix https://github.com/FreshRSS/FreshRSS/issues/4180 Ensure `ctype_alnum()` gets a string * Changelog
Diffstat (limited to 'app/Models/FormAuth.php')
-rw-r--r--app/Models/FormAuth.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/Models/FormAuth.php b/app/Models/FormAuth.php
index d6da637d1..653eba04b 100644
--- a/app/Models/FormAuth.php
+++ b/app/Models/FormAuth.php
@@ -1,7 +1,7 @@
<?php
class FreshRSS_FormAuth {
- public static function checkCredentials($username, $hash, $nonce, $challenge) {
+ public static function checkCredentials(string $username, string $hash, string $nonce, string $challenge): bool {
if (!FreshRSS_user_Controller::checkUsername($username) ||
!ctype_graph($hash) ||
!ctype_graph($challenge) ||
@@ -36,7 +36,7 @@ class FreshRSS_FormAuth {
return [];
}
- private static function renewCookie($token) {
+ private static function renewCookie(string $token) {
$token_file = DATA_PATH . '/tokens/' . $token . '.txt';
if (touch($token_file)) {
$limits = FreshRSS_Context::$system_conf->limits;
@@ -48,7 +48,7 @@ class FreshRSS_FormAuth {
return false;
}
- public static function makeCookie($username, $password_hash) {
+ public static function makeCookie(string $username, string $password_hash) {
do {
$token = sha1(FreshRSS_Context::$system_conf->salt . $username . uniqid('' . mt_rand(), true));
$token_file = DATA_PATH . '/tokens/' . $token . '.txt';