Site banner change bug
还没有人认领这个 Issue。
评估
调研方向
从 src/Filament/Pages/Settings/ManageTheme.php 开始,检查 preventFilePathTampering() 附近的横幅上传验证。使用 FILESYSTEM_DISK=local 在 Manage Theme 中重现已有横幅的情况,然后验证当前横幅会显示、可以删除并且可以替换,而不会出现文件路径错误。
由索引模型根据 Issue 内容生成。
描述
Hi!
After installing Cachet I navigated to "Manage Theme" in Dasboard to upload a custom banner image.
I accidentally uploaded a wrong image and was about to replace it just to get an error "The banner image field contains a file path that is not permitted."
I tried multiple different images but then I noticed that the site shows the image but the "Manage Theme" page did not. I couldn't even remove the uploaded image. Without making any changes but hitting the save button gave also "The banner image field contains a file path that is not permitted."
After a lot of investigating I figured out the reason. The Filament is rejecting the stored path during validation.
I tried to run "artisan optimize:clear". My .env has "FILESYSTEM_DISK=local" setting.
I had to make an change to:
vendor/cachethq/core/src/Filament/Pages/Settings/ManageTheme.php
I changed:
->preventFilePathTampering()
to
->preventFilePathTampering( allowFilePathUsing: fn (string $file): bool => \Illuminate\Support\Facades\Storage::disk( (string) config('cachet.uploads.disk') )->exists($file) )
After this the "Manage Theme" started showing the current banner image. I was able to delete that and upload a new image
- 主要语言
- PHP
- 星标
- 230
- 派生
- 83
- 平均合并
- 12 小时 42 分钟
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cachethq/core 的其他 Issue
-
Banner image upload fails with "The banner image field contains a file path that is not permitted"未关闭
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 5/5 一周以上 新手友好度 25/100
-
filament
难度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
Infrastructure: actions Module: zmscitizenapi Module: zmsentities php Type: Bug unit tests
难度 2/5 1-3 小时 新手友好度 88/100
it-at-m/eappointment#3480 ·
维护者通常 1 天内回复
-
CI: composer install fails — league/flysystem 1.x blocked by security advisory GHSA-cxf4-7mrp-vvpr未关闭devops type: bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
needs approval
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 3 天内回复
-
product / avatars product / self-hosted product / storage
难度 2/5 1-3 小时 新手友好度 78/100
appwrite/appwrite#13985 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复