Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Web Development
>
Backend Management
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
1.3K
Star
3.3K
Fork
1.6K
meystack
/
SwiftAdmin
Code
Issues
8
Pull Requests
0
Insights
Pipelines
Service
PHPDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
插件的安装方法未进行接口请求后的内容响应校验
Backlog
#IA4CJO
AriFe.Liu
Opened this issue
2024-06-11 15:06
### 版本号 v1.1.9 ### 问题描述 `app/admin/system/Plugin.php` 文件中的downLoad方法中, 使用了Http::get去请求官方接口获取插件信息, 该请求在正常情况下会获取到服务器返回的插件列表信息 是在个别情况下, 例如我今日遇到的, 我的服务器由于dns配置仅配置了ipv6的解析, 造成在实际代码中guzzle实例化的客户端无法访问官方API. 此时Http::request报错: cURL error 6, Http::get进一步处理后返回了空字符串 Plugin::downLoad以及Plugin->getPluginList方法中均在使用Http::get请求后未进行响应结果校验, 直接使用json_decode转换数组后对一个空对象NULL使用关联索引造成报错; ### 业务代码 ```html $PluginApiList = Http::get(config('app.api_url') . 'plugin/index', ['limit' => $this->limit]); $PluginApiList = json_decode($PluginApiList, true)['data']; ``` ### 截图补充 ### 友好承诺 - [x] 我承诺将本着相互尊重、理解和友善的态度进行交流,共同维护 SwiftAdmin 良好的社区氛围。
### 版本号 v1.1.9 ### 问题描述 `app/admin/system/Plugin.php` 文件中的downLoad方法中, 使用了Http::get去请求官方接口获取插件信息, 该请求在正常情况下会获取到服务器返回的插件列表信息 是在个别情况下, 例如我今日遇到的, 我的服务器由于dns配置仅配置了ipv6的解析, 造成在实际代码中guzzle实例化的客户端无法访问官方API. 此时Http::request报错: cURL error 6, Http::get进一步处理后返回了空字符串 Plugin::downLoad以及Plugin->getPluginList方法中均在使用Http::get请求后未进行响应结果校验, 直接使用json_decode转换数组后对一个空对象NULL使用关联索引造成报错; ### 业务代码 ```html $PluginApiList = Http::get(config('app.api_url') . 'plugin/index', ['limit' => $this->limit]); $PluginApiList = json_decode($PluginApiList, true)['data']; ``` ### 截图补充 ### 友好承诺 - [x] 我承诺将本着相互尊重、理解和友善的态度进行交流,共同维护 SwiftAdmin 良好的社区氛围。
Comments (
1
)
Sign in
to comment
Status
Backlog
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
bug
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (1)
Tags (8)
master
v2.1.0
v2.0.0
v1.1.91
v1.1.9
v1.1.8.1
v1.1.8
v1.1.6
v1.1.5
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(1)
PHP
1
https://gitee.com/meystack/swiftadmin.git
git@gitee.com:meystack/swiftadmin.git
meystack
swiftadmin
SwiftAdmin
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register