mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-04 15:26:43 +02:00
fix: check for database connection and podcasts table existence before redirecting to install
fix signature regex
This commit is contained in:
parent
cacd228098
commit
eb74e81c3d
6 changed files with 22 additions and 29 deletions
|
|
@ -39,29 +39,25 @@ class NoteController extends ActivityPubNoteController
|
|||
|
||||
public function _remap(string $method, string ...$params): mixed
|
||||
{
|
||||
if (count($params) < 2) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
if (
|
||||
($this->podcast = (new PodcastModel())->getPodcastByName($params[0])) === null
|
||||
($podcast = (new PodcastModel())->getPodcastByName($params[0],)) === null
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
$this->podcast = $podcast;
|
||||
$this->actor = $this->podcast->actor;
|
||||
|
||||
if (
|
||||
($note = (new NoteModel())->getNoteById($params[1])) === null
|
||||
count($params) > 1 &&
|
||||
($note = (new NoteModel())->getNoteById($params[1])) !== null
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
$this->note = $note;
|
||||
|
||||
unset($params[0]);
|
||||
unset($params[1]);
|
||||
}
|
||||
|
||||
$this->note = $note;
|
||||
|
||||
unset($params[0]);
|
||||
unset($params[1]);
|
||||
|
||||
return $this->{$method}(...$params);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue