File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -348,13 +348,12 @@ public function lmhash($password = "") {
348
348
* @return string hash value
349
349
*/
350
350
public function nthash ($ password = "" ) {
351
- if (function_exists ('mhash ' ))
352
- if (defined ('MHASH_MD4 ' ))
353
- return strtoupper (bin2hex (mhash (MHASH_MD4 ,iconv ('UTF-8 ' ,'UTF-16LE ' ,$ password ))));
354
- else
355
- return strtoupper (hash ('md4 ' , iconv ("UTF-8 " ,"UTF-16LE " ,$ password )));
351
+ if (function_exists ('hash ' ))
352
+ return strtoupper (hash ('md4 ' , iconv ("UTF-8 " ,"UTF-16LE " ,$ password )));
353
+ elseif (function_exists ('mhash ' ) && phpversion () < '8.1 ' && defined ('MHASH_MD4 ' ))
354
+ return strtoupper (bin2hex (mhash (MHASH_MD4 ,iconv ('UTF-8 ' ,'UTF-16LE ' ,$ password ))));
356
355
else
357
- error (_ ('Your PHP install does not have the mhash() function. Cannot do hashes. ' ),'error ' ,'index.php ' );
356
+ error (_ ('Your PHP install does not have hash() nor mhash() function. Cannot do hashes. ' ),'error ' ,'index.php ' );
358
357
}
359
358
360
359
/**
You can’t perform that action at this time.
0 commit comments