Added patch for stop a bug of bcrypt with null characters
This commit is contained in:
parent
421a54bd3c
commit
16cd13edbc
1 changed files with 14 additions and 0 deletions
|
|
@ -55,6 +55,20 @@ class PasswordField extends CharField {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Fix for check bug with null password
|
||||||
|
|
||||||
|
//$value=str_replace("\x00", "\\x00", $value);
|
||||||
|
if(strpos($value, "\x00")!==false)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->error=1;
|
||||||
|
|
||||||
|
$this->std_error=I18n::lang('common', 'error_null_password', 'Bcrypt have problems using null characters...');
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$hash_password=password_hash($value, PASSWORD_DEFAULT);
|
$hash_password=password_hash($value, PASSWORD_DEFAULT);
|
||||||
|
|
||||||
return $hash_password;
|
return $hash_password;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue