We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
首先很感谢作者的付出。插件很好用。 使用的问题请留意。一个是格式函数弃用,另外一个dingtalk key多了下划线代码对应不上。
private static function _sign(string $url, string $secret): string { [$s1, $s2] = explode(' ', microtime()); $timestamp = (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000); $data = $timestamp . "\n" . $secret; $signStr = base64_encode(hash_hmac('sha256', $data, $secret, true)); #这部分做的兼容 if(PHP_VERSION_ID < 82000){ $signStr = mb_convert_encoding($signStr, 'UTF-8', 'ISO-8859-1'); } else { $signStr = utf8_encode(urlencode($signStr)); } $signStr = mb_convert_encoding(urlencode($signStr), 'UTF-8', 'ISO-8859-1'); return $url . "×tamp=$timestamp&sign=$signStr"; }
The text was updated successfully, but these errors were encountered:
感谢反馈
Sorry, something went wrong.
fix: utf8_encode php8.2版本弃用了。抛出钉钉时候报错 #10
910eff2
最新版本已发布:https://github.com/Tinywan/webman-exception/releases/tag/v1.1.6
No branches or pull requests
首先很感谢作者的付出。插件很好用。
使用的问题请留意。一个是格式函数弃用,另外一个dingtalk key多了下划线代码对应不上。
class DingTalkRobotEvent
private static function _sign(string $url, string $secret): string
{
[$s1, $s2] = explode(' ', microtime());
$timestamp = (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);
$data = $timestamp . "\n" . $secret;
$signStr = base64_encode(hash_hmac('sha256', $data, $secret, true));
#这部分做的兼容
if(PHP_VERSION_ID < 82000){
$signStr = mb_convert_encoding($signStr, 'UTF-8', 'ISO-8859-1');
} else {
$signStr = utf8_encode(urlencode($signStr));
}
$signStr = mb_convert_encoding(urlencode($signStr), 'UTF-8', 'ISO-8859-1');
return $url . "×tamp=$timestamp&sign=$signStr";
}
The text was updated successfully, but these errors were encountered: