Sicherheitsupdate nach Audit (0.29.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m50s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m34s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m45s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m30s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m7s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m9s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m8s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m5s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m5s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m50s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m34s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m45s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m30s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m7s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m9s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m8s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m5s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m5s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a37895a16a
commit
f1202bea08
226 changed files with 1952 additions and 450 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Inhaus\Plugins\News\Filament\Resources\NewsPosts;
|
||||
|
||||
use App\Filament\Components\SafeUpload;
|
||||
use BackedEnum;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\DeleteAction;
|
||||
|
|
@ -112,7 +113,7 @@ class NewsPostResource extends Resource
|
|||
->options(fn () => FormEmbed::options())
|
||||
->visible(fn () => FormEmbed::available())
|
||||
->searchable(),
|
||||
FileUpload::make('cover_path')
|
||||
SafeUpload::apply(FileUpload::make('cover_path'))
|
||||
->label('Titelbild')
|
||||
->helperText('Querformat, mindestens 1600 × 900 Pixel.')
|
||||
->image()
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class NewsApiController extends Controller
|
|||
'author' => $post->author ? ['id' => $post->author->id, 'name' => $post->author->name, 'avatar_url' => $post->author->avatarUrl(96)] : null,
|
||||
// Inhalt als Blöcke (wie im Pagebuilder) und als reiner Text
|
||||
'blocks' => $rendered['blocks'],
|
||||
'text' => $content->plainText($post->blocks()),
|
||||
'text' => $content->plainText($rendered),
|
||||
]]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ class NewsCommentController extends Controller
|
|||
public function update(Request $request, NewsComment $comment): RedirectResponse
|
||||
{
|
||||
abort_unless($comment->user_id === $request->user()->id, 403);
|
||||
// Nur solange der Beitrag sichtbar ist und Kommentare offen sind
|
||||
$post = $comment->post;
|
||||
abort_unless($post && $post->comments_enabled && $post->isPublished() && $post->isVisibleTo($request->user()), 403, 'Kommentare sind für diesen Beitrag geschlossen.');
|
||||
|
||||
$data = $request->validate(['body' => ['required', 'string', 'max:'.NewsComment::MAX_LENGTH]], [], ['body' => 'Kommentar']);
|
||||
$comment->forceFill(['body' => trim($data['body']), 'edited_at' => now()])->save();
|
||||
|
|
|
|||
|
|
@ -165,7 +165,8 @@ class NewsEditorController extends Controller
|
|||
}
|
||||
|
||||
$content = $this->content->sanitize(json_decode($data['content'] ?? '[]', true) ?: []);
|
||||
$text = $this->content->plainText($content);
|
||||
// Nur allgemein sichtbare Blöcke – der Text dient Suche und Auszügen für alle
|
||||
$text = $this->content->plainText($content, publicOnly: true);
|
||||
|
||||
$post->fill([
|
||||
'title' => $data['title'],
|
||||
|
|
|
|||
|
|
@ -26,9 +26,14 @@ class NewsPostPolicy
|
|||
return $user->can('news.manage') || ($post->category_id && $user->can('news.post.create', ['news_category', $post->category_id]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Veröffentlichte Beiträge löscht nur, wer in der Kategorie veröffentlichen darf
|
||||
* (gilt im Portal und im Backend gleichermaßen).
|
||||
*/
|
||||
public function delete(User $user, NewsPost $post): bool
|
||||
{
|
||||
return $this->update($user, $post);
|
||||
return $this->update($user, $post)
|
||||
&& ($post->status !== NewsPost::PUBLISHED || $this->publish($user, $post->category_id));
|
||||
}
|
||||
|
||||
public function publish(User $user, ?int $categoryId): bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue