Site banner change bug
まだ誰も着手していません。
評価
調査の方向性
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分
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 1週間以上 初心者へのやさしさ 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 日以内に返信