This repository was archived by the owner on Jul 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
overtrue
reviewed
Jul 19, 2018
src/Events/Catched.php
Outdated
*/ | ||
public function __construct(array $result) | ||
{ | ||
// $this->file = $file; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要的代码就删除,不需要保留
src/StorageManager.php
Outdated
@@ -85,6 +86,90 @@ public function upload(Request $request) | |||
|
|||
return response()->json($response); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前面少了空行
src/StorageManager.php
Outdated
$imgUrl = str_replace('&', '&', $imgUrl); | ||
$pathRes = parse_url($imgUrl); | ||
$queryString = isset($pathRes['query']) ? $pathRes['query'] : ''; | ||
$imgUrl = str_replace('?' . $queryString, '', $imgUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不应该去掉图片 URL 的 query,很多图片带不带 query 是不同的
src/StorageManager.php
Outdated
*/ | ||
private function download($url, $config) | ||
{ | ||
$imgUrl = htmlspecialchars($url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不建议对 URL 进行处理
src/StorageManager.php
Outdated
fclose($file); | ||
preg_match('/[\/]([^\/]*)[\.]?[^\.\/]*$/', $imgUrl, $m); | ||
$original = $m ? $m[1] : ''; | ||
$ext = strtolower(strrchr($original, '.')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文件名与文件拓展,请使用 SplFile:
$img = new SplFileInfo('/path/to/file.jpg');
var_dump($img-> getExtension()); // "jpg"
yueziii
added a commit
to yueziii/laravel-ueditor
that referenced
this pull request
Jul 20, 2018
Merge pull request overtrue#56 from yueziii/master
yueziii
added a commit
to yueziii/laravel-ueditor
that referenced
this pull request
Jul 20, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.