php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #69157
Patch typo_fix_crypt revision 2015-03-02 13:42 UTC by zorro_damian at hotmail dot com

Patch typo_fix_crypt for Unknown/Other Function Bug #69157

Patch version 2015-03-02 13:42 UTC

Return to Bug #69157 | Download this patch
Patch Revisions:

Developer: zorro_damian@hotmail.com

Wrong example script at 
/manual/en/function.crypt.php => 'Example #1 crypt() examples'.

WRONG:
if (hash_equals($hashed_password, crypt($user_input, $hashed_password)) {
   echo "Password verified!";
}

GOOD:
if (hash_equals($hashed_password, crypt($user_input, $hashed_password))) {
   echo "Password verified!";                                          ^
}                                                               This fixes it.

The example script closes the: crypt(), hash_equals(), but not the if().
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 10:01:32 2024 UTC