Compatible with PHP 7.0

pull/25/head v1.4.5
sy-records 2023-10-19 08:37:59 +08:00
parent cb26713b32
commit 48df76994b
No known key found for this signature in database
GPG Key ID: C3BB4FF13CD72ACE
2 changed files with 8 additions and 4 deletions

View File

@ -254,6 +254,7 @@ function oss_upload_thumbs($metadata)
//获取上传路径
$wp_uploads = wp_upload_dir();
$basedir = $wp_uploads['basedir'];
$upload_path = oss_get_option('upload_path');
//获取oss插件的配置信息
$oss_options = get_option('oss_options', true);
@ -263,7 +264,6 @@ function oss_upload_thumbs($metadata)
if (!empty($metadata['file'])) {
// Maybe there is a problem with the old version
$file = $basedir . '/' . $metadata['file'];
$upload_path = oss_get_option('upload_path');
if ($upload_path != '.') {
$path_array = explode($upload_path, $file);
if (count($path_array) >= 2) {
@ -434,7 +434,7 @@ function oss_read_dir_queue($homePath, $uploadPath)
$foundFiles = [];
while (!$dirsToProcess->isEmpty()) {
[$currentDir, $relativeDir] = $dirsToProcess->dequeue();
list($currentDir, $relativeDir) = $dirsToProcess->dequeue();
foreach (new DirectoryIterator($currentDir) as $fileInfo) {
if ($fileInfo->isDot()) continue;

View File

@ -4,8 +4,8 @@ Donate link: https://qq52o.me/sponsor.html
Tags: oss, 阿里云, 对象存储, aliyun
Requires at least: 4.2
Tested up to: 6.3
Requires PHP: 7.0.0
Stable tag: 1.4.4
Requires PHP: 7.0
Stable tag: 1.4.5
License: Apache2.0
License URI: http://www.apache.org/licenses/LICENSE-2.0.html
@ -73,6 +73,10 @@ License URI: http://www.apache.org/licenses/LICENSE-2.0.html
== Changelog ==
= 1.4.5 =
- 兼容 PHP 7.0
= 1.4.4 =
- 修复超大文件原图上传和删除