正在显示
1 个修改的文件
包含
10 行增加
和
1 行删除
| @@ -64,7 +64,16 @@ class UploadFile | @@ -64,7 +64,16 @@ class UploadFile | ||
| 64 | $this->isUpload = false; | 64 | $this->isUpload = false; | 
| 65 | // 是不是远程路径 | 65 | // 是不是远程路径 | 
| 66 | if(str_starts_with($tempFile, 'http://') || str_starts_with($tempFile, 'https://')){ | 66 | if(str_starts_with($tempFile, 'http://') || str_starts_with($tempFile, 'https://')){ | 
| 67 | - $content = @file_get_contents($tempFile); | 67 | + // 是不是本地文件 | 
| 68 | + if(str_contains($tempFile, str_replace(['https://','http://'],'',APP_HOST))){ | ||
| 69 | + $url = parse_url($tempFile); | ||
| 70 | + if(is_file(PUBLIC_PATH.$url['path'])){ | ||
| 71 | + $content = @file_get_contents(PUBLIC_PATH.$url['path']); | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + if(empty($content)) | ||
| 76 | + $content = @file_get_contents($tempFile); | ||
| 68 | } | 77 | } | 
| 69 | // 以文件内容的形式保存 | 78 | // 以文件内容的形式保存 | 
| 70 | else{ | 79 | else{ | 
- 
请 注册 或 登录 后发表评论