mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-02 12:17:38 +08:00
Merge pull request #320 from WizardPro/patch-1
fix: php7.4 hexdec deprecation notice. close #319
This commit is contained in:
commit
7d5a919bb4
@ -19,6 +19,7 @@
|
||||
"ext-simplexml":"*",
|
||||
"ext-libxml": "*",
|
||||
"ext-json": "*",
|
||||
"ext-bcmath": "*",
|
||||
"yansongda/supports": "^2.0",
|
||||
"symfony/http-foundation": "^4.0",
|
||||
"symfony/event-dispatcher": "^4.0"
|
||||
|
@ -419,7 +419,9 @@ class Support
|
||||
$dec = 0;
|
||||
$len = strlen($hex);
|
||||
for ($i = 1; $i <= $len; $i++) {
|
||||
$dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
|
||||
if (ctype_xdigit($hex[$i - 1])) {
|
||||
$dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
|
||||
}
|
||||
}
|
||||
return $dec;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user