Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Site banner change bug

オープン 初心者向け
#471 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
laravel, php
領域
backend

調査の方向性

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cachethq/core のほかの issue

cachethq/core の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。