PHP81버전 대응 충돌수정

This commit is contained in:
thisgun
2022-06-13 14:32:14 +09:00
19 changed files with 170 additions and 3690 deletions

View File

@ -3924,6 +3924,38 @@ function is_include_path_check($path='', $is_input='')
return true;
}
function check_auth_session_token($str=''){
if (get_session('ss_mb_token_key') === get_token_encryption_key($str)) {
return true;
}
return false;
}
function update_auth_session_token($str=''){
set_session('ss_mb_token_key', get_token_encryption_key($str));
}
function get_token_encryption_key($str=''){
$token = G5_TABLE_PREFIX.(defined('G5_SHOP_TABLE_PREFIX') ? G5_SHOP_TABLE_PREFIX : '').(defined('G5_TOKEN_ENCRYPTION_KEY') ? G5_TOKEN_ENCRYPTION_KEY : '').$str;
return md5($token);
}
function get_random_token_string($length=6)
{
if(function_exists('random_bytes')){
return bin2hex(random_bytes($length));
}
$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
$characters_length = strlen($characters);
$output = '';
for ($i = 0; $i < $length; $i++)
$output .= $characters[rand(0, $characters_length - 1)];
return bin2hex($output);
}
function filter_input_include_path($path){
return str_replace('//', '/', $path);
}