Phppass password with quotation marks not verified

When I submit the password with quotation mark through the form " and use:

$hasher = new PasswordHash(10, FALSE);
$hasher->CheckPassword($password_safe, $retrieved_password));

He always fails.

But if I indicate $password_safehow

$password_safe = 'myPass"word';

It is checked correctly. How can I avoid $password_safethat the check can still be performed?

+4
source share
1 answer

I also noticed this problem.

There are two ways. Pass the password string through mysql_real_escape_string()or even better addslashes().

0
source

All Articles