mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 03:06:43 +02:00
fix(fediverse): do not cache remote action form + fix typo on post routes for passing post uuid
+ remove unnecessary session->start() directive
This commit is contained in:
parent
3189f12206
commit
4ecb42f7c8
8 changed files with 20 additions and 39 deletions
|
|
@ -249,28 +249,17 @@ class PostController extends FediversePostController
|
|||
$this->registerPodcastWebpageHit($this->podcast->id);
|
||||
}
|
||||
|
||||
$cacheName = implode(
|
||||
'_',
|
||||
array_filter(['page', "post#{$this->post->id}", "remote_{$action}", service('request') ->getLocale()]),
|
||||
);
|
||||
$data = [
|
||||
'metatags' => get_remote_actions_metatags($this->post, $action),
|
||||
'podcast' => $this->podcast,
|
||||
'actor' => $this->actor,
|
||||
'post' => $this->post,
|
||||
'action' => $action,
|
||||
];
|
||||
|
||||
if (! ($cachedView = cache($cacheName))) {
|
||||
$data = [
|
||||
'metatags' => get_remote_actions_metatags($this->post, $action),
|
||||
'podcast' => $this->podcast,
|
||||
'actor' => $this->actor,
|
||||
'post' => $this->post,
|
||||
'action' => $action,
|
||||
];
|
||||
helper('form');
|
||||
|
||||
helper('form');
|
||||
|
||||
return view('post/remote_action', $data, [
|
||||
'cache' => DECADE,
|
||||
'cache_name' => $cacheName,
|
||||
]);
|
||||
}
|
||||
|
||||
return (string) $cachedView;
|
||||
// NO VIEW CACHING: form has a CSRF token which should change on each request
|
||||
return view('post/remote_action', $data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue