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

log() expects parameter to be double, string given #9

Closed
SteveEdson opened this issue Jul 7, 2015 · 2 comments
Closed

log() expects parameter to be double, string given #9

SteveEdson opened this issue Jul 7, 2015 · 2 comments

Comments

@SteveEdson
Copy link

When I started to pass in my user input, I'm getting the following error

log() expects parameter to be double, string given

Here is the stacktrace

log() expects parameter 1 to be double, string given
 /project/vendor/bjeavons/zxcvbn-php/src/ZxcvbnPhp/Matchers/Match.php:202
 /project/vendor/bjeavons/zxcvbn-php/src/ZxcvbnPhp/Matchers/DictionaryMatch.php:68
 /project/vendor/bjeavons/zxcvbn-php/src/ZxcvbnPhp/Searcher.php:47
 /project/vendor/bjeavons/zxcvbn-php/src/ZxcvbnPhp/Zxcvbn.php:56

This is the code in Match.php:

protected function log($number)
    {
        echo $number;
        return log($number, 2);
    }

My user data array looks like this:

Array
(
    [0] => SteveEdson
    [1] => Steve Edson
)

But the value of the $number variable is 559120719120713561135611SteveEdson

Have I done anything wrong, or is this a bug?

My full code is

$zxcvbn = new Zxcvbn();

$strength = $zxcvbn->passwordStrength($password, [
    $username,
    $full_name
]);

Thanks.

@SteveEdson
Copy link
Author

Interestingly, this works without an issue

$strength = $zxcvbn->passwordStrength($password, [
    'username' => $username,
    'full_name' => $full_name
]);

@SteveEdson
Copy link
Author

Sorry, scrap that. The function doesn't fail with that last array, but it doesn't take account of the data either.

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

2 participants