Fork me on GitHub

Changes for #1058

Description changed by chris98 (2015-11-12 09:31:00)

 1:  1:
 If the user username/password is incorrect when logging into the forum and the user is using PHP 5.6+, then you'll get the following warning: If the user username/password is incorrect when logging into the forum and the user is using PHP 5.6+, then you'll get the following warning:
  
 [code]Errno [2] hash_equals(): Expected user_string to be a string, null given in /home/XXX/public_html/forums/include/functions.php on line 147[/code] [code]Errno [2] hash_equals(): Expected user_string to be a string, null given in /home/XXX/public_html/forums/include/functions.php on line 147[/code]
  
 This is taken from my fork, so the line number may not be exactly accurate. But it points to this line: This is taken from my fork, so the line number may not be exactly accurate. But it points to this line:
  
 [code]return hash_equals($a, $b);[/code] [code]return hash_equals($a, $b);[/code]
  
 To remedy this, the following fix should be made: To remedy this, the following fix should be made:
  
 [code]return hash_equals((string)$a, $b);[/code] [code]return hash_equals((string)$a, $b);[/code]
  
 The reason you get the warning is because if no results are returned from the database (e.g. incorrect credentials) then the password will be NULL. The reason you get the warning is because if no results are returned from the database (e.g. incorrect credentials) then the password will be NULL.
 +
 +Thanks to Quy for pointing this out to me ;)