修复新版PHP中 插件无法更新 无法加载问题

PHP:Deprecated: Array and string offset access syntax with curly braces is deprecated
体现在插件中心无法更新插件 永中office无法使用问题 
看到论坛有人反馈的问题 http://bbs.kodcloud.com/d/418
pull/403/head
Jiale Liu 2020-02-17 14:46:42 +08:00 committed by GitHub
parent d127431303
commit f0d66bef01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1028,7 +1028,7 @@ function des_encode($key, $text){
return base64_encode($encrypted);
}
function pkcs5_unpad($text){
$pad = ord($text{strlen($text)-1});
$pad = ord($text[strlen($text)-1]);
if ($pad > strlen($text)) return $text;
if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return $text;
return substr($text, 0, -1 * $pad);
@ -1036,4 +1036,4 @@ function pkcs5_unpad($text){
function pkcs5_pad($text, $block = 8){
$pad = $block - (strlen($text) % $block);
return $text . str_repeat(chr($pad), $pad);
}
}