Skip to content
This repository was archived by the owner on Aug 22, 2021. It is now read-only.

Commit 582ed47

Browse files
committed
fix md5 filename
1 parent f73f639 commit 582ed47

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/StorageManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function fetch(Request $request)
102102
return $this->error('UPLOAD_ERR_NO_FILE');
103103
}
104104
$urls = array_unique($urls);
105-
105+
106106
$list = array();
107107
foreach ($urls as $key => $url) {
108108
$img = $this->download($url, $config);
@@ -144,7 +144,7 @@ private function download($url, $config)
144144
$img = new \SplFileInfo($pathRes['path']);
145145
$original = $img->getFilename();
146146
$ext = $img->getExtension();
147-
$title = config('ueditor.hash_filename') ? md5($original) . '.' . $ext : $original;
147+
$title = md5($url) . '.' . $ext;
148148
$filename = $this->formatPath($config['path_format'], $title);
149149
$info = [
150150
'state' => 'SUCCESS',
@@ -169,7 +169,7 @@ private function download($url, $config)
169169
}
170170
$content = stream_get_contents($file);
171171
fclose($file);
172-
172+
173173
$info['file'] = $content;
174174
$info['siez'] = strlen($content);
175175
return $info;

src/config/ueditor.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
],
2020
],
2121

22-
// 是否使用 md5 格式文件名
23-
'hash_filename' => true,
24-
2522
// 上传 配置
2623
'upload' => [
2724
/* 前后端通信相关的配置,注释只允许使用多行方式 */

0 commit comments

Comments
 (0)