kopia lustrzana https://github.com/pixelfed/pixelfed
Update StatusController, restrict edits to 24 hours
rodzic
3545937ec7
commit
ae24433b8c
|
@ -229,8 +229,8 @@ class StatusController extends Controller
|
||||||
$user = Auth::user()->profile;
|
$user = Auth::user()->profile;
|
||||||
$status = Status::whereProfileId($user->id)
|
$status = Status::whereProfileId($user->id)
|
||||||
->with(['media'])
|
->with(['media'])
|
||||||
|
->where('created_at', '>', now()->subHours(24))
|
||||||
->findOrFail($id);
|
->findOrFail($id);
|
||||||
|
|
||||||
return view('status.edit', compact('user', 'status'));
|
return view('status.edit', compact('user', 'status'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,6 +240,7 @@ class StatusController extends Controller
|
||||||
$user = Auth::user()->profile;
|
$user = Auth::user()->profile;
|
||||||
$status = Status::whereProfileId($user->id)
|
$status = Status::whereProfileId($user->id)
|
||||||
->with(['media'])
|
->with(['media'])
|
||||||
|
->where('created_at', '>', now()->subHours(24))
|
||||||
->findOrFail($id);
|
->findOrFail($id);
|
||||||
|
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
|
@ -254,7 +255,7 @@ class StatusController extends Controller
|
||||||
|
|
||||||
$media = Media::whereProfileId($user->id)
|
$media = Media::whereProfileId($user->id)
|
||||||
->whereStatusId($status->id)
|
->whereStatusId($status->id)
|
||||||
->find($id);
|
->findOrFail($id);
|
||||||
|
|
||||||
$changed = false;
|
$changed = false;
|
||||||
|
|
||||||
|
@ -263,7 +264,7 @@ class StatusController extends Controller
|
||||||
$changed = true;
|
$changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($media->filter_class != $filter) {
|
if ($media->filter_class != $filter && in_array($filter, Filter::classes())) {
|
||||||
$media->filter_class = $filter;
|
$media->filter_class = $filter;
|
||||||
$changed = true;
|
$changed = true;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue