Skip to content

Commit

Permalink
PHP 8.1 부터 deprecate 되는 해시함수 수정
Browse files Browse the repository at this point in the history
그누보드5는 PHP 5.2.17 부터 지원이라 무관합니다
  • Loading branch information
kitrio committed May 19, 2022
1 parent b3d5345 commit ea2187e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions shop/inicis/libs/sha256.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
* Ability to define "_NANO_SHA2_UPPER" to yeild upper case hashes.
* 2009-08-01: Added ability to attempt to use mhash() prior to running pure
* php code.
* 2022-05-19: PHP 8.1 부터 deprecate 되는 mhash() 삭제
*
* NOTE: Some sporadic versions of PHP do not handle integer overflows the
* same as the majority of builds. If you get hash results of:
Expand Down Expand Up @@ -211,11 +212,7 @@ function hash($str, $ig_func = false)

// check for php's internal sha256 function, ignore if ig_func==true
if ($ig_func == false) {
if (version_compare(PHP_VERSION,'5.1.2','>=')) {
return hash("sha256", $str, false);
} else if (function_exists('mhash') && defined('MHASH_SHA256')) {
return base64_encode(bin2hex(mhash(MHASH_SHA256, $str)));
}
}

/*
Expand Down

0 comments on commit ea2187e

Please sign in to comment.