Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

改一下验证码读取session的错误吧 #33

Open
xushuyi888 opened this issue May 6, 2024 · 0 comments
Open

改一下验证码读取session的错误吧 #33

xushuyi888 opened this issue May 6, 2024 · 0 comments

Comments

@xushuyi888
Copy link

password_verify(): Passing null to parameter #2 ($hash) of type string is deprecated

是否为bug

为什么session.php配置store为redis,序列化参数也改为'serialize'=>['json_encode', 'json_decode']之后,居然无法使用验证函数,请问这算是BUG吗, 报错:password_verify(): Passing null to parameter #2 ($hash) of type string is deprecated

// /vendor/topthink/think-captcha/src/Captcha.php
将 $key = $this->session->get('captcha.key');
改成
$arr = $this->session->get('captcha');
$key = $arr->key;
就可以了

修改了一下代码,麻烦大佬修复一下。

文件: /vendor/topthink/think-helper/src/helper/Arr.php
方法: public static function get($array, $key, $default = null)
修改:
if (is_object($array[$segment])) {
$array = (array) $array[$segment];
} else {
$array = $array[$segment];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant